Serial Number of Xmega128A1

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

hi.
is xmega has a unique serial number?!
if yes,how can i read this serial with C code?
thanks

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

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.

Have a nice day,
Kraal

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

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;
}

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

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.

Gamu The Killer Narwhal
Portland, OR, US
_________________
Atmel Studio 6.2
Windows 8.1 Pro
Xplained boards mostly