Introduction

Author: Qubo Hu

Watchdog timers are used to ensure that a system can recover from unforeseen failures in firmware or hardware. The watchdog timer will, if used correctly, be able to detect abnormalities in the program execution and respond by resetting the microcontroller (MCU). This brings the MCU to a well-defined and known state where normal operation can be resumed.

The XMEGA® AVR® family offers a very robust internal watchdog: Ordinary integrated watchdog timers often use the CPU clock as clock source, but the XMEGA watchdog timer’s clock source is independent from the CPU clock. This means that failure of the main clock would not affect the watchdog timer operation.

Further, the XMEGA watchdog timer offers the Normal mode, where the watchdog timer must be Reset before a given timeout period, and it offers a Window mode where the watchdog timer can be Reset within a limited period. In Window mode, if the watchdog timer is Reset too early (or too late), a system Reset is triggered.

More information about using watchdog timers can be found in application note AN2551.