XMEGA32A4 / Production Signature Row

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

Hi, Does anyone know about the base address of the production signature row of xmega32a4? I have been going thru the manual, datasheet and other documents, but so far no success. I would apprecaite it if somebody cold hele me on this. I want to load the production calibration vales to ADC. :cry:

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

The production signature base address is 0X0000. From iox32a4.h (WinAvr):

#define PROD_SIGNATURES_START     (0x0000)
#define PROD_SIGNATURES_SIZE      (52)
#define PROD_SIGNATURES_PAGE_SIZE (0)
#define PROD_SIGNATURES_END       (PROD_SIGNATURES_START + PROD_SIGNATURES_SIZE - 1)

Ozhan KD
Knowledge is POWER

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

Hi, Thank you very much for your advice. However, it does not seem to be what I am looking for. If 0x0000 is correct base address, it overlaps General Purpose I/O registers. If I am wrong, I am sorry for it. Thank you.

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

Access to the production signature row is done through the NVM Controller. The "Read Calibration Row" command must be loaded to NVM command register with Z pointer loaded with offset and executing LPM assembly instruction will load the destination by desired value.

Ozhan KD
Knowledge is POWER

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

electronic.designer wrote:
Access to the production signature row is done through the NVM Controller. The "Read Calibration Row" command must be loaded to NVM command register with Z pointer loaded with offset and executing LPM assembly instruction will load the destination by desired value.

Where the heck do you come up with this information?

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

Hi Ozhan K, Thank you very much for your advice, again. So what I shold do is:
1) Set "Read Calibration Row" command in CMD register
2) Set 0x9D in CCP register prior to setting CMDEX bit of CTRLA register
3) Set CMDEX bit of CTRLA register
4) Use Z (R30 and R31) register to point the calibration data.
Is this correct?
Also in using Z register, I only need to write the offset of the calibration data's location. Is this correct?

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

No.
You must use a 4 byte address, not just the offset (2 byte) address.

Also, the addresses are Little Endian, (LSByte first).

JC

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

Hi JC,
Thank you very much for your suggestion. I was looking at XMEGA A manual and so far found two calibration data's offset address, 0x24 and 0x25 for ADCBCAL0 and ADCBCAL1 respectively. I assume the the rest of 2 bytes are the base address. Could you please let me know abot what they are? I have been searching it, but so far no success.

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

The Production Signature Row Base Addr is: 0x008E0200.
Obviously add the Offset for the indivudual register you are looking at, then send it Little Endian, (LSByte first).

This is well hidden, but is in the Xmega A Manual, Fig 30-4. This is the PDI Linear Memory Map for the Xmegas. Look in the Table to the right of the pictorial, and in the pictorial itself.

I hope this helps.

JC

Edit: Above is for External access via NVM controller. I see now that you are doing Internalaccess.

JC

Last Edited: Tue. May 10, 2011 - 03:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi JC, Thank you very much for your help. It is indeed well hidden. I hope Atmel update about the manual or create a separate document about those soon. Thank you very much.

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

GordonFreeman wrote:

Where the heck do you come up with this information?

XMEGA A manual section 30.11.2.14:
Quote:
The Read User Signature Row and Red Calibration Row commands are used to read one byte
from the User Signature Row or Calibration Row.
1. Load the Z-pointer with the byte address to read.
2. Load the NVM CMD register with the Read User Signature Row / Calibration Row
command
3. Execute the LPM instruction.
The destination register will be loaded during the execution of the LPM instruction

Here is the atmel code example for reading ADC calibration value:

void ADC_CalibrationValues_Load(ADC_t * adc)
{
	if(&ADCA == adc){
		 /* Get ADCACAL0 from production signature . */
		adc->CALL = SP_ReadCalibrationByte( PROD_SIGNATURES_START + ADCACAL0_offset );
		adc->CALH = SP_ReadCalibrationByte( PROD_SIGNATURES_START + ADCACAL1_offset );
	}else {
		/* Get ADCBCAL0 from production signature  */
		adc->CALL = SP_ReadCalibrationByte( PROD_SIGNATURES_START + ADCBCAL0_offset );
		adc->CALH = SP_ReadCalibrationByte( PROD_SIGNATURES_START + ADCBCAL1_offset );
	}
}

This is the SP_ReadCalibrationByte detail in assembly:

SP_ReadCalibrationByte:
	ldi		r20, NVM_CMD_READ_CALIB_ROW_gc         ; Prepare NVM command in R20.
	mov		ZL, r16                                ; Load byte index into low byte of Z.
	clr		ZH                                     ; Clear high byte of Z.
	sts		NVM_CMD, r20                           ; Load prepared command into NVM Command register.
	lpm             r16, Z                                 ; Preform a LPM to read out byte to R16

	ldi		r20, NVM_CMD_NO_OPERATION_gc           ; Clear NVM Command register
	sts		NVM_CMD, r20
	ret

DocJC wrote:
The Production Signature Row Base Addr is: 0x008E0200.

This is true when using external PDI programming.

Ozhan KD
Knowledge is POWER

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

Hi, Thank you very much for your inputs. I also found the AVR1316 describing about how to read calibration data. Your code example is better. Thank you.