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

need help about eeprom!

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



Joined: 25 Jan 2010
Posts: 35

View user's profile Send private message MSN Messenger

need help about eeprom!
PostPosted: Mon Apr 19, 2010 12:06 pm     Reply with quote

hello everyone.
i have some questions.here they are;

1)how can i write a float value onto eeprom?for example i want to write ''3.17'' on eeprom.how can i manage this?

2)how can i write a value which is bigger than 255 onto eeprom?for example i want to write "426" on eeprom.how could do this?

3)finally,what is the placeholder for an "int16" variable?is it %d or %lu or something different?

waiting for your helps...
_________________
compiler version: 4.105
pic: 16f876
clock frequency: 4MHz


Last edited by memoally on Mon Apr 19, 2010 12:12 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Apr 19, 2010 12:08 pm     Reply with quote

Can you give your posts a more descriptive name than "Help Please" ?
Put in the thread title the subject that you need help on. Thanks.
(You can edit your post to do this).
memoally



Joined: 25 Jan 2010
Posts: 35

View user's profile Send private message MSN Messenger

PostPosted: Mon Apr 19, 2010 12:23 pm     Reply with quote

better now? Smile
_________________
compiler version: 4.105
pic: 16f876
clock frequency: 4MHz
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Apr 19, 2010 12:32 pm     Reply with quote

Quote:
How can I write a float value onto eeprom?

See this FAQ article:
http://www.ccsinfo.com/faq.php?page=write_eeprom_not_byte

Quote:
How can I write a value which is bigger than 255 onto eeprom?

Look in these two CCS driver files. They have routines to read/write
various data types to/from eeprom. There are separate routines for
internal or external eeprom:
Quote:

c:\program files\picc\drivers\internal_eeprom.c
c:\program files\picc\drivers\external_eeprom.c

Look for these routines:
Quote:

write_int16_eeprom()
read_int16_eeprom()

write_int16_ext_eeprom()
read_int16_ext_eeprom()


Quote:
what is the placeholder for an "int16" variable?

To display any integer larger than a byte, you use "%lu".
That's for unsigned integers. For signed integers, use "%ld".
memoally



Joined: 25 Jan 2010
Posts: 35

View user's profile Send private message MSN Messenger

PostPosted: Mon Apr 19, 2010 1:31 pm     Reply with quote

thank you,pcm programmer.your advices helped me.thank you again.
_________________
compiler version: 4.105
pic: 16f876
clock frequency: 4MHz
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