ATXMEGA256A3U ADC Calibration Values have no effect?

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

I am using the ADC on the ATXMEGA256A3U and it works great (much better than the ATXMEGA256A3).  I am putting the calibration signature into the calibration values as explained in the documentation:

 

		NVM_CMD = NVM_CMD_READ_CALIB_ROW_gc;
		ADCA.CALL = pgm_read_byte(PROD_SIGNATURES_START + PRODSIGNATURES_ADCACAL0);
		printf("i:ADCA Low=%X\n", pgm_read_byte(PROD_SIGNATURES_START + PRODSIGNATURES_ADCACAL0));
		NVM_CMD = NVM_CMD_NO_OPERATION_gc;
		
		NVM_CMD = NVM_CMD_READ_CALIB_ROW_gc;
		ADCA.CALH = pgm_read_byte(PROD_SIGNATURES_START + PRODSIGNATURES_ADCACAL1);
		printf("i:ADCA High=%X\n", pgm_read_byte(PROD_SIGNATURES_START + PRODSIGNATURES_ADCACAL1));
		NVM_CMD = NVM_CMD_NO_OPERATION_gc;

 

For the boards I have tested the value is 11 for both the high and low signatures.

 

I find that my result is the same with or without this calibration code.  Does this just not work or is it just not needed?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Probably you have already found solution, but anyway

 

https://www.avrfreaks.net/forum/p...

 

uint8_t read_production_row(uint16_t prod_row)
{

	uint8_t result;
	
	NVM_CMD = NVM_CMD_READ_CALIB_ROW_gc;
	result  = pgm_read_byte(PROD_SIGNATURES_START + prod_row);
	NVM_CMD = NVM_CMD_NO_OPERATION_gc;

	return result;
		
}

	ADCA_CALL = read_production_row((uint16_t) &PRODSIGNATURES_ADCACAL0);
	ADCA_CALH = read_production_row((uint16_t) &PRODSIGNATURES_ADCACAL1);