Take a look at this thread...
http://www.picbasic.co.uk/forum/showthread.php?t=360
Obviously you don't need the connection to the Battery. You need a large capacitor to act as a reservoir to keep the PIC alive long enough to complete an EEPROM write operation (10mS per byte). You simply detect that the power has failed (or not) by sampling the raw supply input and decide whether to proceed with the Write.
Personally I wouldn't bother... we manufacture hundreds of thosands of products annually, most have some kind of setup in EEPROM which can be user changed with Menu routines. I've yet to hear of a single instance where a system's been corrupted due a power outage. I'm not saying it can't happen, but I am saying that it's a seriously rare occurance that unless I was designing a Mission Critical application (aircraft, medical, elevator, chocolate dispenser kind of thing...) then I wouldn't worry about it.




Bookmarks