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

how do i detect when power is going off using pic 16f676

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







how do i detect when power is going off using pic 16f676
PostPosted: Sat Apr 28, 2007 12:51 am     Reply with quote

how do i detect when power is going off using pic 16f676...inorder save staus of pin c4and counter value..
libor



Joined: 14 Dec 2004
Posts: 288
Location: Hungary

View user's profile Send private message

PostPosted: Sat Apr 28, 2007 3:10 am     Reply with quote

If you have a voltage regulator supplying the PIC, I suggest to measure the voltage on the voltage reg's input using two resistors as a divider.
You can do the measuremet periodically with the A/D converter, or you can also use the PIC built-in comparator. (this would require no measurement routine, if properly set up it would give you an interrupt upon the voltage trip below the setup level, you can use the PIC's on-board variable voltage reference as one input to the comparator)
You did not say if you operate from mains or from battery. In the mains case you have enough capacitor value to supply the PIC some more time after the voltage tripped below the trigger level. If from battery: you have even more time, so that you have to switch off the PIC before the brownout occurs.
dipinch
Guest







reply
PostPosted: Sat Apr 28, 2007 4:27 am     Reply with quote

i am working in mains....my project is power saver using passive infrared senser built with LM324...when power goes i want to store the last either in ON or in OFF state..and in ON state and there is delay when sensor is triggered it switch on all the devices for 5 min.and it continuesly examine if triggr occurs ,when retrigger it sets timer zero....so i want to store timer value..if power goes when device is ON
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