> On Behalf Of jb > > Seems like there was a discussion on this some time ago - check the > archives/uChip app notes. I think the solution was to have a large cap > diode-isolated from the main supply with an input port monitoring > the mains voltage. If it dropped off, the pic would write to flash in the > time it had before the cap was drained. That way you didn't write to flash unless you > were powering down. A lot better than having to put a battery in it. I'm also using a 16C73B that has BOD too - that could be used to fire off the EEPROM write routines. -DO