Angry Badger
Member
HI,
I have built a circuit around an 18F2420. The PIC reads data from a RTCC chip. If the main +5V circuit power fails, a MAX 690 switches in a 3.6v cell to power the RTCC. I want to monitor the backup cell voltage via the PIC. But if the main +5V is lost there will be +3.6V (assuming new cell) on the PIC analogue input wrt the PICs Vdd. So I figure the best thing to do is also power the PIC from the 3.6V cell when power fails but put the PIC into sleep mode.
How do I go about this? Can I use the PBOR to trigger an interupt that will put the PIC to sleep or is it better to use the HLVD function? Never used any of these low power options or interupts before. Reading the data sheet has made my mind go a bit funny.
Be grateful for any advice. Thanks.
I have built a circuit around an 18F2420. The PIC reads data from a RTCC chip. If the main +5V circuit power fails, a MAX 690 switches in a 3.6v cell to power the RTCC. I want to monitor the backup cell voltage via the PIC. But if the main +5V is lost there will be +3.6V (assuming new cell) on the PIC analogue input wrt the PICs Vdd. So I figure the best thing to do is also power the PIC from the 3.6V cell when power fails but put the PIC into sleep mode.
How do I go about this? Can I use the PBOR to trigger an interupt that will put the PIC to sleep or is it better to use the HLVD function? Never used any of these low power options or interupts before. Reading the data sheet has made my mind go a bit funny.
Be grateful for any advice. Thanks.