Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Drivers NVM Example 4 for Xplain Documentation

Introduction

This example shows how to use the NVM fuse and lock bits handling of the NVM driver.

Main Files

Device Info

All AVR XMEGA devices can be used. This example have been tested with the following setup:

  • Xplain * - XMEGA A1 Xplained
  • XMEGA A3BU Xplained

Description of the example

The example uses the NVM fuse and lock bits driver to read a fuse (FUSEBYTE2). The BOOTRST bit (Boot Loader Section Reset Vector) in this fuse is then checked, and if it is set to "Reset Vector = Application Reset" LED1 is toggled. If it isn't set, the LED will not toggle. The user can set the reset vector to Application Reset with an appropriate fuse programmer.

This example also demonstrates how to write different lock bits. It is recommended to perform a chip erase after running this example to make sure all lock bits are cleared.

LED 0 is toggled when the execution of this example is starting. LED 2 is toggled to indicate the reset vector is pointing to application flash section. For the Xplain, LED 7 is toggled when the execution of this example has ended. For the A3BU Xplained, the status LED is toggled when the execution has ended.

Dependencies

This example depends on the following modules:

Compilation info

This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.

Contact Information

For further information, visit Microchip.