PDA

View Full Version : How to read PIC serial no. from EEPROM with PBP?



jellis00
- 10th December 2009, 06:18
I understand that Microchip has written the serial number of the chip into EEPROM for 18Fxxxx chips and that it can be read by PBP code. Can anyone tell me where in the chip memory map of a 18F4550 the serial no. is located and how to use PBP code to read it? I would like to use this as a method of uniquely identifying the location/ID of each embedded processor application that contains one of these chips.

Bruce
- 10th December 2009, 14:42
http://www.melabs.com/resources/samples/18F/readconf.bas
PicBasic Pro program to display PIC18F configuration data on LCD.

This method can also be used to read device id.

The Special Features section of the data sheet shows the device ID locations.

jellis00
- 10th December 2009, 18:09
The Special Features section of the data sheet shows the device ID locations.

Thanks, Bruce, for the code on how to get to the DEVID info. I had seen the DEVICE ID register in the data sheet but didn't see any of the 14 bits that were actually providing a serial number of the individual chip. That is what I am after. From the data sheet DEVID only provides device type (DEVID1<7:5>, device revision(DEVID1<4:0>, device part number (DEVID2<7:0>, none of which appear to be a unique serial number.
Is my information incorrect that there is a unique serial number somewhere in the chip? I was led to believe it was in there by the following statement in the 18F4550 data sheet:
"17.10.6.1 Device Descriptor
The device descriptor provides general information,
such as manufacturer, product number, serial number,
the class of the device and the number of configurations."

This statement doesn't seem to correlate with the DEVID register description in the same data sheet , so if there is a serial number in there it is well hidden in the data sheet info.

Bruce
- 10th December 2009, 18:17
Device Descriptor is the USB info contained in supporting files that are included
at compile time. It's not a serial number embedded in the PIC.

Browse through some of the USB files in your PBP directory.

rmteo
- 10th December 2009, 18:19
The serial number described in 17.10.6.1 Device Descriptor is that of the USB device you are creating and not that of the PIC18F4550.

Melanie
- 11th December 2009, 10:27
You can set eight unique User ID Bytes (either at program time with your programmer, or at run time through your program (on 18F types), but there is no actual unique 'Serial Number' embedded into any PIC, just a product family ID (which is usually used by good programmers to warn you if you have inserted an incorrect PIC for the program you are about to burn).