Hi Graham, imho you are overdoing it a little. All you need is a single switch if you already have a backup battery. A shottky diode network (2 of them) should power your circuit both from the battery and from the regulated power. A pic pin will sense the incoming power going down. You can use a R divider to sense the voltage before the regulator. The switch will be a MOSFET (logic level) and will cut off the supply to the peripherals (leaving the PIC connected to the battery through the backup system). When the PIC senses power down it will do what it does and then turn the MOSFET off, then go to sleep. You can arrange for it to come back when the power comes back, by implementing a wakeup on portb change or such. You can also arrange for the watchdog to run while sleeping and the PIC to briefly wake up every 2 seconds or so, check conditions, and sleep again. This is the way I'd do it anyway. Peter -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu