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 support@ccsinfo.com

#serialize

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



Joined: 16 Sep 2003
Posts: 21

View user's profile Send private message

#serialize
PostPosted: Sat Oct 23, 2004 5:05 pm     Reply with quote

Does anyone have an idea how this serialization works?
I've no idea how to access the serial number. Don't see it reading the
ID locations

From Readme.txt section on serialization
#serialize(id=xxx,next="xxx")

Use only one of the next three options:
file="x" The file x is used to read the serial number from, and this
file is updated by the ICD programmer. It is asumed this is
a one line file with the serial number. The programmer will
increment the serial number.
listfile="x" The file x is used to read the serial number from, and this
file is updated by the ICD programmer. It is asumed this is
a file one serial number per line. The programmer will read the
first line then delete that line from the file.
next="x" The serial number X is used for the first load, then the hex file
is updated to increment x by one.

prompt="text" This option is optional. If specified the user will be prompted
for a serial number on each load. If used with one of the above
three options then the default value the user may use is picked
according to the above rules.

log="xxx" A file may optionaly be specified to keep a log of the date, time,
hex file name and serial number each time the part is programmed.
If no id=xxx is specified then this may be used as a simple log
of all loads of the hex file.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sat Oct 23, 2004 10:08 pm     Reply with quote

You can store the serial number either in dataeeprom or as a C CONST. Here are some examples:

Code:
//Prompt user for serial number to be placed

//at address of serialNumA

//Default serial number = 200int8 const serialNumA=100;

#serialize(id=serialNumA,next="200",prompt="Enter the serial number")

 

//Adds serial number log in seriallog.txt

#serialize(id=serialNumA,next="200",prompt="Enter the serial number", log="seriallog.txt") 

 

//Retrieves serial number from serials.txt

#serialize(id=serialNumA,listfile="serials.txt") 

 

//Place serial number at EEPROM address 0, reserving 1 byte

#serialize(dataee=0,binary=1,next="45",prompt="Put in Serial number")

 

//Place string serial number at EEPROM address 0, reserving 2 bytes

#serialize(dataee=0, string=2,next="AB",prompt="Put in Serial number")

object01



Joined: 13 May 2004
Posts: 90
Location: Nashville, TN

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Oct 27, 2004 9:39 am     Reply with quote

Mark wrote:
You can store the serial number either in dataeeprom or as a C CONST. Here are some examples:

Code:
//Prompt user for serial number to be placed

//at address of serialNumA

//Default serial number = 200int8 const serialNumA=100;

#serialize(id=serialNumA,next="200",prompt="Enter the serial number")


I tried that example in the following code using an int32 rather than an int8:

Code:
unsigned int32 getUnitID() {
   unsigned int32 const serialNumA = 200;
   #serialize(id=serialNumA,next="200",prompt="Enter the serial number")
   return serialNumA;
}


And every time I try to program the device, I'm prompted correctly. But I can't enter anything other than 0 without getting the error, "The ID code is too big for the memory location."

--
Jeff S.
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