This example uses a push button event to simulate a deadlock in program so as to demonstrate how watchdog timer works.
At first, the example configures the pins of LED and Console UART, enables the watchdog timer, and then prints some information via UART. Before user presses the push button that the information mentions, the LED keeps blinking and the counter of the watchdog timer is restarted before any fault of the watchdog timer occurs (the reset in this case). The example enters a deadlock status after user presses the push button and it causes that the counter will not be restarted until a fault occurs (the watchdog reset).
This software is written for GNU GCC and IAR Embedded Workbench for Atmel. Other compilers may or may not work.
SAM4L device can be used.
This example can be used on:
For further information, visit Microchip.
Support and FAQ: https://www.microchip.com/support/