If you have a spare ADC pin available, than you can place a diode (1N4148 for example) and an electrolitic capacitor on the Vdd line to your pic. With the ADC you will monitor the power supply and when you detect a low ( you will establish the safe value) you will jump to the saving routine and write to eeprom all the necessary value the pic will need at start.
An example of what I mean can be seen in the attached hand drawing.
Cheers
Al.
Bookmarks