View previous topic :: View next topic |
Author |
Message |
georpo
Joined: 18 Nov 2008 Posts: 281 Location: Athens, Greece.
|
PIC unique ID |
Posted: Thu Apr 30, 2020 2:47 am |
|
|
Hello,
I would like to know if there is a unique number stored in PIC microcontrollers and how to read it. Currently using a PIC24FJ16GA002.
Not a device ID that is the same among devices. A unique number.
Thanks. _________________ George. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Thu Apr 30, 2020 3:04 am |
|
|
No.
Doing so, would require a programming operation at the end of manufacture,
increasing the price of the chips. There are chips with this but generally
not the PICs
There are quite a few peripheral chips that do carry an ID.
So (for example), network adapter will carry a Mac ID (that should be
unique at supply time, but can be changed). Then many of the EEPROM
chips are offered in versions holding an ID. Devices like the AT24CSW080
have an area of EEPROM, and a preprogrammed serial number.
You can add your own serial as part of your initial programming.
#SERIALIZE in CCS allows a const to be generated that contains a
number that is automatically incremented every time the chip is
programmed (with compatible programmers). |
|
|
georpo
Joined: 18 Nov 2008 Posts: 281 Location: Athens, Greece.
|
|
Posted: Thu Apr 30, 2020 3:13 am |
|
|
Thanks Ttelmah.
Nice idea with the Mac ID.
This is about a WiFi device so Mac ID is the solution.
Thanks again! _________________ George. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Thu Apr 30, 2020 3:52 am |
|
|
As you will gather other people have wanted a unique ID, so routes to
get one have been 'thought about'. Good news on the Mac ID. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Thu Apr 30, 2020 4:48 am |
|
|
Most (all ??) of the DS 'one wire' products also have unique ID numbers in them... I know the DS18B20 temperature sensors do....
Whatever you use, be sure to figure out an 'update' method WHEN you replace a bad sensor or interface card, otherwise you may lose a few hours and a patch of hair wondering WHY it doesn't work anymore ....... BTDT |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Thu Apr 30, 2020 6:35 am |
|
|
Some sort or hash of the programing date which is stored on programming using _DATE (i need to check the actual command/code, please correct this if you know it) would be unique too, unless you have a parallel programming assembly line. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Mon May 04, 2020 3:07 pm |
|
|
temtronic wrote: | Most (all ??) of the DS 'one wire' products also have unique ID numbers in them... I know the DS18B20 temperature sensors do....
|
All Dallas 1-wire devices have a unique serial number - they have to in order to work on the 1-wire bus.
So I would definitely go with that as one solution.
1-wire devices come in all sorts of flavors -- so you can choose to just get a serial number or go all out and add some free sensor inputs.
If the device is going to be on a network, definitely go with the MAC as an ID.
Microchip makes an EEPROM with a built-in MAC using Microchip's assigned OUI if you never want to clash for sure.
With past ethernet designs I've used, I've left room for the MAC to be factory assigned as well (or user configurable since nerds/geeks have those old 10base2 cards we recycle and save the MAC from them. :P )
Cheers,
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
|