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 question for 18F4550

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



Joined: 18 Apr 2006
Posts: 66

View user's profile Send private message Yahoo Messenger

#serialize question for 18F4550
PostPosted: Tue Jul 15, 2008 9:10 pm     Reply with quote

I am trying to use the #serialize function but cannot get it right. I am looking to write a "long" numeric serial number in the internal eeprom locations 1 and 2. I try the below line, but it starts with serial number 256

#serialize(dataee=1,binary=2,next="1",prompt="Enter Sensor ESN 1-60000")

With the above example I wish the file to present the last serial number +1 and allow me to accept or type over it with a new number.


Later in the program I read it from eeprom into a long variable nSSN

nSSN = make16(read_eeprom(1),read_eeprom(2));


I'm sure I am doing something simple wrong. I have tried this with both MachX and ICD

Thanks
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Jul 16, 2008 10:00 am     Reply with quote

Could it be as simple as swapping the bytes? Try swapping the arguments of make(16).

nSSN = make16(read_eeprom(2),read_eeprom(1));
_________________
The search for better is endless. Instead simply find very good and get the job done.
foodwatch



Joined: 18 Apr 2006
Posts: 66

View user's profile Send private message Yahoo Messenger

PostPosted: Wed Jul 16, 2008 10:04 pm     Reply with quote

Thanks for the suggestion... I made the mistake of downloading the latest software for the ICDU and the PWH compiler and now nothing writes to the eeprom no matter which form I choose.

If I use:

#rom int 0xf00001 = {0,5}

I am able to write the eeprom each and every time. (but a pain to implement)

Next I tried to use the serialize function in the MachX programmer software. It asks for my serial number and other details and then the window below says it is writing two bytes to eeprom, but in reality, when I program the 18f4550, nothing happens(in the data eeprom).... no write takes place at all. The non-data eeprom code programs fine. Both ICD and MachX show eeprom data to be written, but when I view the eeprom contents after programming in MachX, no eeprom values are written at all.

Time for a beer and bed :-)
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