View previous topic :: View next topic |
Author |
Message |
Eduardo__
Joined: 23 Nov 2011 Posts: 197 Location: Brazil
|
Any idea how to implement serial number to each uC?(18F24J11 |
Posted: Fri Jul 27, 2012 1:49 pm |
|
|
Any idea how to implement a serial number to each uC?
Detail: My uC has no EEPROM (PIC18F24J11)
Is it possible to write it in some flash location while programming PIC?
I need to write a unique 32bit serial number to each PIC I program. It will be used as a MAC address.
Thanks for any ideas. _________________ Eduardo Guilherme Brandt |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Fri Jul 27, 2012 2:18 pm |
|
|
Check to see if your programmer can auto-increment a location as it programs. Some of the fancier ones can for just this purpose.
Dallas Semiconductor sells a serial number chip. Each chip is manufactured with a unique read only number.
Years ago I did this by writing a program to read the .S19 file, increment a location and make multiple copies. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Eduardo__
Joined: 23 Nov 2011 Posts: 197 Location: Brazil
|
|
Posted: Fri Jul 27, 2012 2:48 pm |
|
|
I think not. I´m Using Microchip ICD2.
But thanks for IDEA.
Eduardo _________________ Eduardo Guilherme Brandt |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Sat Jul 28, 2012 2:44 am |
|
|
This is the 'point' of the #SERIALISE operator.
Whether ICD2 supports this, I don't know, but give it a try. Generate a file 'serials.txt', in the directory with your code, and the programmer is meant to read the number from the file, increment it, and write it back, so gives the auto increment required. :-)
Best Wishes |
|
|
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
|
Posted: Sat Jul 28, 2012 8:11 am |
|
|
Another advantage to the CCS IDE and ICD-U64....not only do you get lightening speed and superior debugging but via #SERIALIZE you get a production programmer..sure it isn't a gang programmer. You can't do better (for a single chip at a time programmer) than the price performance features of a CCS U-64 programmer. |
|
|
Eduardo__
Joined: 23 Nov 2011 Posts: 197 Location: Brazil
|
|
Posted: Sat Jul 28, 2012 9:30 am |
|
|
Yes, I´m going to buy a ICD-U64 on the future for this project.
But, I would like to know whether #serialize works with the flash of the uC or only eeprom?
My uC has no eeprom. _________________ Eduardo Guilherme Brandt |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Sat Jul 28, 2012 11:25 am |
|
|
By default EEPROM
It'll work with your programmer if you use the CCS ICD.
However you can also use it to set a value into a CONST, which is then stored in the flash memory.
Best Wishes |
|
|
Eduardo__
Joined: 23 Nov 2011 Posts: 197 Location: Brazil
|
|
Posted: Sat Jul 28, 2012 6:06 pm |
|
|
Ttelmah, so if I understood correctly, #serialize can work with uCs without eeprom(only flash).
Do you confirm it? _________________ Eduardo Guilherme Brandt |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1349
|
|
Posted: Sat Jul 28, 2012 6:31 pm |
|
|
If you look at the #serialize section of the compiler manual you will see you have two sets of options to pick from:
Flash:
id=<const variable name>
EEPROM
dataee=<address>,binary=<num bytes>
You can use string=<num bytes> instead of binary, but I am not familiar with what that does differently. If you don't want to use EEPROM or have a chip without it, then use the flash option. |
|
|
Eduardo__
Joined: 23 Nov 2011 Posts: 197 Location: Brazil
|
|
Posted: Sat Jul 28, 2012 9:38 pm |
|
|
Pretty good! Thank you a lot!
Solved!!
Regards
Eduardo _________________ Eduardo Guilherme Brandt |
|
|
|