CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC unique ID

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
georpo



Joined: 18 Nov 2008
Posts: 281
Location: Athens, Greece.

View user's profile Send private message

PIC unique ID
PostPosted: Thu Apr 30, 2020 2:47 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 30, 2020 3:04 am     Reply with quote

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.

View user's profile Send private message

PostPosted: Thu Apr 30, 2020 3:13 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 30, 2020 3:52 am     Reply with quote

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. Very Happy
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Apr 30, 2020 4:48 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 30, 2020 6:35 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon May 04, 2020 3:07 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group