-
Unique ID counter
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
-
Re: Unique ID counter
If you are using an melabs programmer, you can do that easily with the Serial Number option.
http://support.melabs.com/DT/SerialNumbers.png
-
Re: Unique ID counter
unfortunately i am not , but gee i would really like that option , is there another way , without buying a new programmer ?
-
Re: Unique ID counter
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 :)
-
Re: Unique ID counter
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
Code:
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
-
Re: Unique ID counter
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
-
Re: Unique ID counter
Choose carefully - I'm very happy with the latest greatest PicKit 3 programmer, but it does not seem to have this option.
-
Re: Unique ID counter
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
-
Re: Unique ID counter
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
-
Re: Unique ID counter
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...
-
Re: Unique ID counter
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 ,