hi.
is xmega has a unique serial number?!
if yes,how can i read this serial with C code?
thanks
Serial Number of Xmega128A1
Author
Message
Hello,
Yes the XMega have a unique serial number, which is located in the "production signature row", it is composed by the registers LOTNUM0, LOTNUM1, LOTNUM2, LOTNUM3, LOTNUM4, LOTNUM5, WAFNUM, COORDX0, COORDX1, COORDY0 and COORDY1.
The manual says they can be read from the application (i.e. "with C code"), but I'm not sure if the NVM controller is needed or if it is just a simple register access.
Level: Moderator
Joined: Mon. Jul 18, 2005
Posts: 105140 View posts
Location: (using avr-gcc in) Finchingfield, Essex, England
A quick Google suggests this will be useful:
static uint8_t SP_ReadCalibrationByte( uint8_t index ) { uint8_t result; /* Load the NVM Command register to read the calibration row. */ NVM_CMD = NVM_CMD_READ_CALIB_ROW_gc; result = pgm_read_byte(index); /* Clean up NVM Command register. */ NVM_CMD = NVM_CMD_NO_OPERATION_gc; return result; }
The ASF contains an example that reads from the Production and User signature rows. It's path is:
\asf-3.4.1\xmega\drivers\nvm\example1
I'm not on my development system, so I can't check, but this may be available as an example project in Atmel Studio 6.