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

store a character in eeprom

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



Joined: 18 Mar 2009
Posts: 38

View user's profile Send private message

store a character in eeprom
PostPosted: Mon Dec 20, 2010 10:45 am     Reply with quote

Could someone explain me why if I try to store a character in eeprom, I must use the following instruction:
Code:

write_eeprom(816,78);


If I try this one, I am not getting the correct character when I read it back:
Code:

write_eeprom(816,'n');


Thanks for the help,

D.
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Mon Dec 20, 2010 10:59 am     Reply with quote

Remember that 78, is the character code for 'N', not 'n'. For 'n', you would get back 110.

Best Wishes
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Mon Dec 20, 2010 11:03 am     Reply with quote

What are you getting back when you try to read it ? (as Ttelmah indicates, a lower case 'n' is 110 decimal (or 0x6E hex)).

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
dynamitron



Joined: 18 Mar 2009
Posts: 38

View user's profile Send private message

PostPosted: Mon Dec 20, 2010 11:55 am     Reply with quote

For N, I get 'B'

I am just curious because otherwise using the ascii code, it works fine
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 20, 2010 12:09 pm     Reply with quote

Post a simple test program that shows the problem. Example:
http://www.ccsinfo.com/forum/viewtopic.php?t=17590&start=1
It should be complete and compile without errors, similar to the
program shown in the link above.

Also post your compiler version.

Also, tell us if you have ever programmed that eeprom location with
a continuous loop for a long time, and possibly burned out the eeprom.
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Mon Dec 20, 2010 2:12 pm     Reply with quote

Obvious question - What chip - how much EEPROM does it have?.

Best Wishes
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