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

Any idea how to implement serial number to each uC?(18F24J11

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



Joined: 23 Nov 2011
Posts: 197
Location: Brazil

View user's profile Send private message

Any idea how to implement serial number to each uC?(18F24J11
PostPosted: Fri Jul 27, 2012 1:49 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jul 27, 2012 2:18 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jul 27, 2012 2:48 pm     Reply with quote

I think not. I´m Using Microchip ICD2.

But thanks for IDEA.
Eduardo
_________________
Eduardo Guilherme Brandt
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Sat Jul 28, 2012 2:44 am     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Sat Jul 28, 2012 8:11 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Jul 28, 2012 9:30 am     Reply with quote

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: 19513

View user's profile Send private message

PostPosted: Sat Jul 28, 2012 11:25 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Jul 28, 2012 6:06 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Jul 28, 2012 6:31 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Jul 28, 2012 9:38 pm     Reply with quote

Pretty good! Thank you a lot!

Solved!!
Regards
Eduardo Very Happy
_________________
Eduardo Guilherme Brandt
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