Introduction - If you have any usage issues, please Google them yourself
HLVD Power Down Save code example for PIC18F46J11 at 3.3V.
*
* This example demonstrates using an HLVD interrupt to quickly
* detect when power has been cut the microcontroller.
*
* While powered, the firmware simply increments a counter
* variable and displays the value on the serial port. When
* power is cut, the firmware quickly saves data to
* non-volatile FLASH memory during the short period of
* time where capacitors are keeping the microcontroller
* running.