Pages: [1] 2   Go Down
Author Topic: Unique processor identifier?  (Read 1180 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
It was like it when I found it
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Brattain Member
*****
Karma: 239
Posts: 24371
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

EEPROM
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31483
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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 Offline
Brattain Member
*****
Karma: 331
Posts: 16523
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Brattain Member
*****
Karma: 239
Posts: 24371
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16523
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Brattain Member
*****
Karma: 509
Posts: 31483
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No you can only read them in programming mode, page 298 of the data sheet.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16523
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Brattain Member
*****
Karma: 509
Posts: 31483
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Lefty,
I see you have gone back to your old picture, that clip from the end of Dr. Strangelove.   smiley
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12465
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16523
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lefty,
I see you have gone back to your old picture, that clip from the end of Dr. Strangelove.   smiley

Yes, last night they crowned a new Baseball World Series Champion for 2011, so time to revert back.  smiley-cry
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 239
Posts: 24371
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

'World Series'?
Who got invited to that?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31483
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
'World Series'?
Who got invited to that?
Why the whole world got invited, but only one country showed up.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8453
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

'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 smiley) 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

Rob Gray aka the GRAYnomad www.robgray.com

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16523
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

'World Series'?
Who got invited to that?

Canada and half the players these days are from Latin America.  smiley-wink

Logged

Pages: [1] 2   Go Up
Jump to: