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

How do I specify the upper 8 bit of the 16 bit field

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



Joined: 11 Nov 2008
Posts: 29

View user's profile Send private message

How do I specify the upper 8 bit of the 16 bit field
PostPosted: Fri Feb 06, 2009 12:03 pm     Reply with quote

Hi all,

I am using PCWHD Version 4.073

I want to save a 16 bit address in the eeprom of a 18F2520. I understand write_eeprom(address, value) will write an 8 bit value at the address. How do I specify the upper 8 bit of the 16 bit field and then the lower 8 bits?

I have:

int16 start_addr = 0000;
int16 end_addr = 16384;
int16 address;

write_eeprom(0x00,address);

Ray
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 06, 2009 12:10 pm     Reply with quote

See my post in this thread. It has routines to save a word to eeprom.
This example is for external eeprom, but you can change it to use
internal eeprom by removing the word "ext_" from the function names.
http://www.ccsinfo.com/forum/viewtopic.php?t=27405
frierray



Joined: 11 Nov 2008
Posts: 29

View user's profile Send private message

PostPosted: Fri Feb 06, 2009 1:52 pm     Reply with quote

Thanks so much, that works great.
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