UK
Offline
Jr. Member
Karma: 0
Posts: 90
It was like it when I found it
|
 |
« on: October 29, 2011, 10:52:33 am » |
Hi,
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.....
Any suggestions?
Regards
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 143
Posts: 19365
I don't think you connected the grounds, Dave.
|
 |
« Reply #1 on: October 29, 2011, 11:36:30 am » |
EEPROM
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 299
Posts: 26024
Solder is electric glue
|
 |
« Reply #2 on: October 29, 2011, 01:14:17 pm » |
Is there any form of unique Identifier on an arduino mega processor No, you have to make one like suggested above.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #3 on: October 29, 2011, 01:45:02 pm » |
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.
Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 143
Posts: 19365
I don't think you connected the grounds, Dave.
|
 |
« Reply #4 on: October 29, 2011, 01:46:13 pm » |
Unique to chip type, but are they unique to chip?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #5 on: October 29, 2011, 01:59:23 pm » |
Unique to chip type, but are they unique to chip?
No of course not, so not a solution to the OP's requirement. But as he was already told EEPROM allows a pretty straight forward solution. However my question still stands, can a sketch program be made to read the chip's signature bytes? Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 299
Posts: 26024
Solder is electric glue
|
 |
« Reply #6 on: October 29, 2011, 02:05:15 pm » |
No you can only read them in programming mode, page 298 of the data sheet.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #7 on: October 29, 2011, 02:33:30 pm » |
No you can only read them in programming mode, page 298 of the data sheet.
OK, thanks for that. Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 299
Posts: 26024
Solder is electric glue
|
 |
« Reply #8 on: October 29, 2011, 02:35:20 pm » |
Lefty, I see you have gone back to your old picture, that clip from the end of Dr. Strangelove. 
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 101
Posts: 9551
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #9 on: October 29, 2011, 02:38:16 pm » |
A solution might be to add a one-wire device, these all have a 64 bit unique ID, - http://www.maxim-ic.com/products/1-wire/ -
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #10 on: October 29, 2011, 04:32:32 pm » |
Lefty, I see you have gone back to your old picture, that clip from the end of Dr. Strangelove.  Yes, last night they crowned a new Baseball World Series Champion for 2011, so time to revert back. 
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 143
Posts: 19365
I don't think you connected the grounds, Dave.
|
 |
« Reply #11 on: October 29, 2011, 04:41:21 pm » |
'World Series'? Who got invited to that?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 299
Posts: 26024
Solder is electric glue
|
 |
« Reply #12 on: October 29, 2011, 05:02:22 pm » |
'World Series'? Who got invited to that? Why the whole world got invited, but only one country showed up.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 75
Posts: 6970
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #13 on: October 29, 2011, 08:23:36 pm » |
'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. ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #14 on: October 29, 2011, 08:52:12 pm » |
'World Series'? Who got invited to that?
Canada and half the players these days are from Latin America. 
|
|
|
|
|
Logged
|
|
|
|
|
|