Quote Originally Posted by Amoque View Post
I do not believe this is possible, unless there is some other indication from the system of an impending power loss (or I misunderstand the nature of your inquiry). Two ideas come to mind, either use an alternate power supply to power the PIC after shut-down and "detect" the loss of main power to activate the write or, write the values routinely in the main program and start from them on power up each time.
You isolate the PIC power from the power supply with a diode. Place a large cap on the PIC side of that diode to power the PIC when the power fails, and interrupt the PIC & write the eeprom when power failure is sensed on the other side of the diode. Very possible. HTH