Serial identification for ATMEGA328P chip

Hello,

I have 3 ATMEGA328P chips. Assume chips are called X, Y, Z.

I want X to read data serially from Y when they are connected through Rx & Tx but reject data if Z is connected instead of Y.

I think this can be done by chip identification or specifying a serial number to the chip but I don’t know how to do it.

Any ideas?

Welcome to the forum.

During manufacturing, the AVR chips get codes which can be read. They are called "signature bytes" and can be read with "boot_signature_byte_get()" from boot.h.
For the ATmega32U4 (Arduino Leonardo), there is a unique number that can be used to identify the Arduino board. However, that is not guaranteed for the ATmega328P.

The usual way is to store a number in EEPROM. That could go wrong if the EEPROM is cleared.

The best way is to use a DS18B20 temperature sensor. They all have a guaranteed unique serial number. If you buy a DS18B20 from AliExpress/Ebay/Amazon, then you have a counterfeit temperature sensor. No one knows how unique those counterfeit numbers are :woozy_face:

A common way in the past is to use dip-switches. That is still a good option.

Thank you for your reply.

My project is similar to the idea of the printer. It accepts only original toners or cartridges (my project is not a printer but I need this identification concept). So I assume that the toner has a chip that has a special identification.

Maybe this can help in having a better understanding of my question.

write once a unique serial number in the EEPROM.
Read that serial number in your setup()

See

you can use EEPROM.put and EEPROM.get

Thank you. I'll check it