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

how to use eeprom read and write commands..any one help me.

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



Joined: 07 Jul 2011
Posts: 5

View user's profile Send private message

how to use eeprom read and write commands..any one help me.
PostPosted: Sat Dec 17, 2011 5:22 am     Reply with quote

Actually I want to save the value of a variable at the instant of power failure. Again when power came the stored value must read from memory and used for output.

Code:

write_EEPROM(add,inc1);
write_EEPROM(add1,dec1);
l= read_EEPROM(add1);
m= read_EEPROM(add);

I used this in my coding but its not working.
It returns only 0.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sat Dec 17, 2011 1:17 pm     Reply with quote

We need to know more than this.

Give us a FULL but SMALL example we can compile.

Include in your reply the version of compiler.

Your example should include the device as without that info, we can't tell if your device even has EEPROM...


-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Ttelmah



Joined: 11 Mar 2010
Posts: 19537

View user's profile Send private message

PostPosted: Sat Dec 17, 2011 4:00 pm     Reply with quote

Also, how are you detecting that power has failed?.
At what voltage?.
How long will power still be high enough to support the EEPROM write operation after this?.

Best Wishes
karti.m



Joined: 07 Jul 2011
Posts: 5

View user's profile Send private message

regarding eeprom
PostPosted: Mon Dec 19, 2011 10:04 am     Reply with quote

am using pic16f873a,its a 5V device...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 19, 2011 2:06 pm     Reply with quote

Here are some threads that discuss saving data to eeprom before power-down:
http://www.ccsinfo.com/forum/viewtopic.php?t=44144
http://www.ccsinfo.com/forum/viewtopic.php?t=25733
http://www.ccsinfo.com/forum/viewtopic.php?t=46723
http://www.ccsinfo.com/forum/viewtopic.php?t=30706
http://www.ccsinfo.com/forum/viewtopic.php?t=37757
karti.m



Joined: 07 Jul 2011
Posts: 5

View user's profile Send private message

PostPosted: Tue Dec 20, 2011 10:21 am     Reply with quote

thanx a lot for ur links...
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