Hi, In a project at hand, I would like to save some data into the onboard EEPROM of a PIC16F870 when the power fails or is turned off. A large capacitor in the power supply ensures that when the main supply fails, there are still a few hundred milliseconds before the supply into PIC touches zero. How can one detect such a power failure and then immediately launch into the EEPROM write subroutine (while there is juice in the capacitor)? I don't really want to save the data regularly after every few seconds (analogous to Autosave in MS Word), but only when the power goes. Thanks, Mohit. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics