Question relating Atmega8a-au

Hello, Guys
by the way, I have some pcs of atmega8a-au then want to use them but I have a question please:
atmega8a-au is has unique id?

The MiniCore core supports the atmega8.

how to read unique id of atmega8a-au ?
another question for atmega8a-au is it has real unique id I mean each chip different id?

I do not think it does. Read the datasheet.

A quick search for "unique", "identifier", and "GUID" show no results that indicate that the chip has an identifier.

That was my conclusion as well when I did a search.

How about these models atmega88-au & atmega168-au?

Nothing like that in the ATmega48A/PA/88A/PA/168A/PA/328/P datasheet.

Also checked the ATmega16U4/ATmega32U4 (Leonardo/Micro). No luck there either.

You can easily add a unique identifier by adding a DS18B20 temperature sensor. It's a OneWire device with a 64-bit globally unique address.

good idea :slight_smile:
is there any code for read address from ds18b20 & compare it with variable?

// Include the libraries we need
#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

// arrays to hold device address
DeviceAddress MyID;

/*
   Setup function. Here we do the basics
*/
void setup(void)
{
  // start serial port
  Serial.begin(115200);

  // locate devices on the bus
  sensors.begin();
  if (!sensors.getAddress(MyID, 0))
  {
    Serial.println("Unable to find address for Device 0");
    while (1) {} // No DS18B20. Freeze here
  }

  printAddress(MyID);
}

void loop(void) {}

// function to print a device address
void printAddress(DeviceAddress deviceAddress)
{
  for (uint8_t i = 0; i < 8; i++)
  {
    if (deviceAddress[i] < 16)
      Serial.print("0");
    Serial.print(deviceAddress[i], HEX);
  }
}

tested code then address I got as : 287A9E459218027C
so next step how compare address iwith variable if correct can print right and if not correct print wrong?

const byte DesiredAddress[8] = 
{0x28, 0x7A, 0x9E, 0x45, 0x92, 0x18, 0x02, 0x7C};

boolean CheckAddress(DeviceAddress addr)
{
  for (int i=0; i<8; i++)
    if (addr[i] != DesiredAddress[i])
      return false;
  return true;
}

@johnwasser
thanks for your help :slight_smile: