This example demonstrates how to use the reset cause interface.
The reset cause interface is described in the CPU reset cause section.
All AVR devices can be used. This example has been tested with the following setup:
The example will set LEDs on the board depending on the reset cause. The LEDs are wired to reset causes in the following order:
Where boards have less than the number of LEDs given above, the list is shorted to the number of available LEDs.
On boards with at least one button, the first available button will be used to trigger a software reset when pressed.
Users will observe different LEDs active depending if the device was reset by toggling power, external reset input, reset triggered by programming and debug tools and finally triggered by pressing the on-board button.
This example depends on the gpio.h interface.
This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.
For further information, visit Microchip.