Go Down

Topic: Unique processor identifier? (Read 1 time) previous topic - next topic

Lima7

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

AWOL

"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.

Grumpy_Mike

Quote
Is there any form of unique Identifier on an arduino mega processor

No, you have to make one like suggested above.

retrolefty

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


AWOL

Unique to chip type, but are they unique to chip?
"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.

retrolefty


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

Grumpy_Mike

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

retrolefty


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


OK, thanks for that.

Lefty

Grumpy_Mike

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

robtillaart

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/ -

Rob Tillaart

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

retrolefty


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.  =(

AWOL

'World Series'?
Who got invited to that?
"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.

Grumpy_Mike

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

Why the whole world got invited, but only one country showed up.

Graynomad

'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 
Rob Gray aka the GRAYnomad www.robgray.com

retrolefty


'World Series'?
Who got invited to that?


Canada and half the players these days are from Latin America.  ;)


Go Up