PDA

View Full Version : Unique ID counter



longpole001
- 17th July 2012, 08:54
Hi guys ,

I am looking for a way to put a counter value to use as an unique word ID, but with no repeated values untill all values are used 00 00 - FF FF

Any suggestion on how it might be done automatically when i program a pic and it be assigned to EEprom location for usage in the program.

Regards

Sheldon

Darrel Taylor
- 17th July 2012, 16:56
If you are using an melabs programmer, you can do that easily with the Serial Number option.

http://support.melabs.com/DT/SerialNumbers.png

longpole001
- 18th July 2012, 02:14
unfortunately i am not , but gee i would really like that option , is there another way , without buying a new programmer ?

ScaleRobotics
- 18th July 2012, 06:06
If they are all to carry the same firmware, you can have Microchip program them for you, for a fee. They can program a unique serial number using their Serialized Quick-Turn Programming (SQTP) . But, it might be cheaper to buy a MeLabs programmer :)

pedja089
- 18th July 2012, 10:47
If you are good in windows programing, try to create VBS, or some .exe, that will change that values in hex file, and send it to programmer, using command line option to start programmer.
It should be easy job...
Something like this vbs

Dim i as integer
strbuff as string
For i = 0 to 65535
Open SorceHexPath For Input As #1
Input #1, strbuff
Close #1

'Find & Change eeprom value

Open EditedHexPath For Input As #1
print #1,strbuff
Close #1
Shell programerpath -pPIC etc....
Next i

longpole001
- 18th July 2012, 12:04
thanks guys , ill try the windows program option , i am not a big VB user but found my way around most things to use it in the past

but in the long run a new programmer seems a better step, as i am looking to use some of the lastest PIC in the future , 16F1825, 1829 , which my current PIC programer has no hope of doing

Charlie
- 18th July 2012, 13:47
Choose carefully - I'm very happy with the latest greatest PicKit 3 programmer, but it does not seem to have this option.

longpole001
- 18th July 2012, 15:54
ah thanks for the info , been doing the net search for do almost all pic programmer , its hard to find at a good price for sure

longpole001
- 19th July 2012, 12:27
well after thinking about 20 mins and that one of the other members here had a melab U2 programmer for sale , i got that ,, so this small option of setting serial when programming should now be solved

comwarrior
- 30th July 2012, 01:38
Another way of doing it would be to use a PIC to store the current serial number in it's eeprom (that way it's not lost if you power it down).
Use a simple serial link from the 'new' pic that needs a number to the PIC with the serial number count.
The 'new' send a serial command to the master pic to request a number and the master sends the latest unique number. 'new' pic writes it to it's onboard eeprom and never asks for a new number upon boot.

It's similar to the way DHCP works on TCP/IP networking... Thats where i got the idea from...

longpole001
- 30th July 2012, 02:19
another way and i am still looking at this is the product id code built into each pic this is readable and may be unique ,