Serial Number

Each ATmega48PB/88PB/168PB has an integrated serial number (also called unique device ID) that can be used to uniquely identify each part.

There are two approaches to get the serial number information.

One way is to read the Signature Row from software. For detailed information, refer to section "Reading the Signature Row from Software" in the latest data sheet.

Table 1. Signature Row Addressing
Signature Byte Z-Pointer Address
Device Signature Byte 1 0x0000
Device Signature Byte 2 0x0002
Device Signature Byte 3 0x0004
RC Oscillator Calibration Byte 0x0001
Serial Number Byte 1 0x000E
Serial Number Byte 0 0x000F
Serial Number Byte 3 0x0010
Serial Number Byte 2 0x0011
Serial Number Byte 5 0x0012
Serial Number Byte 4 0x0013
Serial Number Byte 6 0x0015
Serial Number Byte 7 0x0016
Serial Number Byte 8 0x0017

If the serial number feature is used across several device families the device signature bytes should also be included in the serial number. Extending the serial number to a 12-byte number.

Another way is to read I/O address 0xF0 - 0xF8, as the ATmega48PB/88PB/168PB serial number can be accessed through I/O registers SNOBRx. The serial number is made from concatenating the nine bytes read out from these read-only registers. See sub-chapter SNOBRx - Serial Number Byte 8 to 0 for more detail.

An example of how to read out the serial number is given below:
C Code Example

uint8_t serial_num[9] = {0};

for(uint8_t i = 0; i < 9; i++){
	serial_num[i] = *((uint8_t *) &DEVID0+i);

SNOBRx - Serial Number Byte 8 to 0