I've done one with similar requirements for saving information into EEROM. If you are powered from an AC line, then there must already be enough C in the power supply to carry you over from one half-cycle to the next, or 8.3 mS at 60Hz. That is already probably long enough to grab a counter and stuff it into an EEROM. Increasing the C by a factor of 3 or 4 (or 10) to give you some room to play will probably not cost very much at all. The hard part is that you must recognize the loss of AC power as soon as possible. I did this by conditioning the AC half-cycles from a rectifier into near-square-wave pulses clipped to GND and VCC, and sampling this signal (connected to a digital I/O line) every couple of milliseconds. If I see no pulses for 16mS (one cycle at 60Hz), then I'm pretty certain the power has failed (real world AC power can go away for half a cycle due to someone turning on a big motor sometimes), but that I still have at least 20mS of usable power. Making a part you already have (the capacitor) biggger will have a much smaller effect on your reliability than will adding several components including an electrochemical one (battery) that has a higher intrinsic failure rate. Besides it will be smaller and cheaper. > -----Original Message----- > From: Graham [mailto:Graham.D@WANADOO.FR] > Sent: Sunday, November 26, 2000 5:52 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [EE]: battery backup strategy > > > This is my first attempt at a battery backup strategy. = no experience > > 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 > > My proposed solution is: > > use ICL7673 with two external PNP transistors, as per their data sheet > circuit to maintain a supply to the whole system. > > I added a switching FET at the backup battery supply. Use an > input pin on > PIC to monitor main supply line, use another one as output to > hold the FET > on so backup battery is available to the 7673. > > If the main supply line goes lower than battery (by 50mv) the > 7673 will > switch....next check (or interupt driven) the pic sees the > main supply line > now low....it then goes into a 'preserve critical data in > eeprom' routine(ie > demands a final count from the counter chip)....after which > it powers down > the FET control line in the battery supply and cuts it's own > throat. Next > power up it goes back to monitor main supply and holds FET on to make > available battery back up ....(loop) > > will it fly ??.....gotchas ???....experiences ??... > > I am concerned that the switch over time of the icl7673 is > too long (50us) > > better way ???...(I can see more complex and much more expensive ways) > > (I added a simple resistor+diode to trickle the batteries) > > Graham > > > > > -Need *high IP3* AND good N/F ?? try this- http://www.rfham.com > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu