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

Save information

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



Joined: 04 May 2008
Posts: 260

View user's profile Send private message

Save information
PostPosted: Wed Nov 19, 2008 1:37 pm     Reply with quote

Hi

How I can save for example a state with PIC18F252 for when I turn off power it stay saved.

for example

Code:
int8 STATE;

void main()
{

if (jumper==1) STATE=input(PIN_B7) //I like save in eeprom this value

//read value STATE and put them for I can use in next cicle

if (STATE==1) funct();

}

How I can make this simple example? STATE only need save 0 or 1.

kind regards, Filipe
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Nov 19, 2008 2:20 pm     Reply with quote

See this sample code. It shows how to save the state of a variable in
eeprom, and then restore the variable when the PIC is turned on again.
http://www.ccsinfo.com/forum/viewtopic.php?t=22109&start=17
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