how do i detect when power is going off using pic 16f676
Posted: Sat Apr 28, 2007 12:51 am
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
Posted: Sat Apr 28, 2007 3:10 am
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
Posted: Sat Apr 28, 2007 4:27 am
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
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