Is there any form of unique Identifier on an arduino mega processor (something that can be accessed programatically) ? I want to build a dozen identical arduino units, each running the same software, but each with a different ID. At the moment I change a single line in my code each time I upload, but this relies on me remembering to make the change, and loading the right ID into the correct arduino. I guess what I'm looking for is something like this....
if serial_number = 1234 then
ID = A
if serial_number = 5678 then
ID = B
etc etc.....
Well AVR chips do have 'signature bytes' that are unique to the chip type and AVRDUDE can read them, but I have no idea if one can read those bytes at run time to determine what chip type the code is running on.
'World Series', after all these years I still get a laugh out of that.
Re the unique ID, if you can handle the (very slight) possibility of having duplicates you can generate a random number (I think we should start a thread about generating random numbers :)) on power up and burn that into EEPROM at run time.
If they absolutely have to be unique then you'll have to run a counter on your PC and burn it from there.
(I think we should start a thread about generating random numbers ) on power up and burn that into EEPROM at run time.
I think we did a thread from hell several months ago looking for a good/great random power up value to seed the random function. No 'perfect' solution was found as I recall, but I would defer to Coding Badly on that.
These are super-handy. DS-2401, $0.80 in qty 25, TO-92 package.
For this same task, I do use the EEPROM, and generate an .eep file and then burn that, so "make eeprom-id PORT=/dev/ttyUSB0 ID=10" drops '10' in the right spot.
Thanks guys - looks like the one wire solution will best meet my needs in the long term. In the short term, since my devices include an SD card I think I'll add a file to each card that contains a unique ID - although that still relies on me slotting the correct card into the correct arduino!
World Series? isn't that named after the bloke who established it, rather than being a reference to who it's open to?