Skip to content

Library to read out unique serial number from SAM D21 MCU, e.g. Adafruit Feather M0

License

Notifications You must be signed in to change notification settings

mkretzschmar/SAMD21Serialnumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAMD21Serialnumber

Library providing a function to read out the 128 bit unique serialnumber of a SAMD21 chip, e.g. Adafruit Feather M0.

For details take a look to

https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/Atmel-42181-SAM-D21_Datasheet.pdf

(9.3.3, page 32)
Each device has a unique 128-bit serial number which is a concatenation of four 32-bit words contained at the following addresses:

  • Word 0: 0x0080A00C
  • Word 1: 0x0080A040
  • Word 2: 0x0080A044
  • Word 3: 0x0080A048

The uniqueness of the serial number is guaranteed only when using all 128 bits.

Example Code

#include <SAMD21DeviceID.h>
SAMD21 samd = SAMD21();
char serialnumber[33];
void setup() {
  Serial.begin(9600);
  samd.getSerialNumber(serialnumber);
  Serial.print("[SETUP] chip serial#: 0x");
  Serial.println(serialnumber);
}
...

About

Library to read out unique serial number from SAM D21 MCU, e.g. Adafruit Feather M0

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages