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

shutdown

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



Joined: 14 Aug 2007
Posts: 31

View user's profile Send private message

shutdown
PostPosted: Tue Sep 04, 2007 6:29 am     Reply with quote

How can programming the pic ( if power is shutdown the pic no reset but start from last step before power shutdown)
Ttelmah
Guest







PostPosted: Tue Sep 04, 2007 7:18 am     Reply with quote

You can't.
Not possible in the hardware. The program counter (as well as the other similar registers), are SRAM. The contents of these are only maintained, when power is applied.
Now, there are some possibilities:
1) Have a small lithium cell as a 'backup' battery, and put the PIC into a 'sleep' (power saving) mode, when power is removed. A typical PIC, without clock, will happily sit doing nothing, for several years powered by such a cell.
2) If it is not the exact code location, but what the chip was 'doing', that needs to be restored, then build your code as a state machine, and use the power-fail interrupt, to just record the state. Then when power is restored, re-initialise all the I/O, and jump directly to the stored state.

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