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

Eeprom question

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







Eeprom question
PostPosted: Thu Feb 10, 2005 5:55 am     Reply with quote

How to write some number let's say "5" into memory.
Then read it and display it on LCD.

Becuse i have to increase each number, after each button click,
what is the best way to make this work...

button press
5 -- write to memory
read from memory
display until next button click
6 -- write to memory .....


Thanx in advance
Guest








Re: Eeprom question
PostPosted: Thu Feb 10, 2005 7:28 am     Reply with quote

TaiChipy wrote:
How to write some number let's say "5" into memory.
Then read it and display it on LCD.

Becuse i have to increase each number, after each button click,
what is the best way to make this work...

button press
5 -- write to memory
read from memory
display until next button click
6 -- write to memory .....


After the button press, you would increment a variable in RAM at the next button click, then store it in EEPROM. You might want to read back the variable you just saved in EEPROM and verify if it matches the variable you have in RAM. Reason why i say this is - suppose the write to the EEPROM location failed for some reason or another. You don't want to display the wrong character on the LCD.

As it stands though, your pseudocode should work just fine.
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