Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Watchdog example for SAM4L8 Xplained Pro Documentation

Introduction

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).

Main Files

Compilation Information

This software is written for GNU GCC and IAR Embedded Workbench for Atmel. Other compilers may or may not work.

Device Information

SAM4L device can be used.

Requirements

This example can be used on:

  • SAM4L evaluation kit
  • SAM4L Xplained Pro kit
  • SAM4L8 Xplained Pro kit

Usage

  • Build the program and download it to the evaluation board.
  1. On the computer, open and configure a terminal application (e.g., HyperTerminal on Microsoft Windows) with these settings:
    • 115200 bauds
    • 8 bits of data
    • No parity
    • 1 stop bit
    • No flow control
  2. In the terminal window, the following text should appear (values depend on the board and chip used):
    -- Watchdog example --
    -- xxxxxx-xx
    -- Compiled: xxx xx xxxx xx:xx:xx --
  3. A LED keeps blinking and watchdog timer is cleared before watchdog timeout.
  4. The example will enter a deadlock status if user presses the push button and it will trigger an watchdog reset in about 5 seconds.

Contact Information

For further information, visit Microchip.
Support and FAQ: https://www.microchip.com/support/