Saturday 30 January 2016

Arduino Due and the Watchdog

A watchdog is used to detect when a system has gone off with the fairies; you have to reset the watchdog timer ("pat the watchdog") every so often or it takes some recovery action. In the case of the Arduino Due, with the ATSAM3X8E MCU, the recovery action is to reset the CPU.

In the ATSAM3X8E (and probably other Atmel MCUs, too), the watchdog timeout defaults to 16 seconds, and the default hardware state is that the watchdog is enabled! (the default in the Atmel Software Framework is to disable the watchdog unless you have defined CONF_BOARD_KEEP_WATCHDOG_AT_INIT).