> The requirement is to continue powering a 16f84 + a counter chip + two > relative encoders, total around 3 to 50 ma at 5v, depending on activity, for > 'a few seconds', then grab the count from the counter and move it to > internal eeprom, then power everything down until main supply > returns.....for a price+simplicity Your switched battery idea seems workable, but I would also investigate using a large capacitor instead since you only need a relatively small amount of energy once every time main power goes off. For example, a 20,000uF cap will droop 5V after delivering 50mA for 2 seconds. Therefore, if you kept a 20,000uF cap at 5V over your regulator drop out voltage, it would power your circuit until it would shut down anyway. That probably means the cap needs to be kept at around 11 volts normally. I have seen "memory backup" capacitors which are physically small with very high capacitance, from about .05F to 1F (yes, one Farad). The ones I've seen were only a little over 5 volts, but higher voltages may be available. Note that a 1F cap droops only 100mV if drained at 50mA for 2 seconds. This may be all you need connected directly to your 5V supply if you can guarantee that the regulator won't draw current when reversed. Another approach would be to use a chopper to produce the 5V from a range of DC voltages like 2.5 to 5V, just like many battery circuits. That would allow more droop from the storage cap before the 5V went away. ***************************************************************** Olin Lathrop, embedded systems consultant in Devens Massachusetts (978) 772-3129, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body