Microchip | The Embedded Control Solutions Company Register Login
Browse All
Microchip Technology
 305 Code Snippets

HLVD Power Down Save code example

Microchip Technology

This example demonstrates using an HLVD interrupt to quickly detect when power has been cut from the microcontroller.

About this Code Example

* 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 from 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.
*
* When power is restored, the firmware reads FLASH memory,
* finds the most recently stored data and restores state.
* The counter then continues where it left off.
*
* This example is intended to operate at 8MHz, which is the
* maximum speed for this part to operate down to the minimum
* Vdd specification. The minimum voltage for writing to FLASH
* is specified at 2.25V, but the write should still work if
* enough capacitance is provided to keep Vddcore up for the
* duration of the write.

Categories

Release History

  • Jul 22, 2011

    Version: 1.0.0

    First upload to ECS

Download Contact the Developer

*Required Fields

  • Current Version:1.0.0
  • Created:Jul 22, 2011
  • Updated:Feb 26, 2015
  • Downloads:2817
  • MPLAB Version:latest
  • C Compiler:C18 v3.34 or above
  • Development Tools:n/a
  • Supported Devices:PIC18F46J11

Corporate News

Resources

Stay Connected

Stay up to date with the latest news from Microchip Technology.