This example shows how to use the NVM fuse and lock bits handling of the NVM driver.
All AVR XMEGA devices can be used. This example have been tested with the following setup:
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.
This example depends on the following modules:
This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.
For further information, visit Microchip.