Watchdogs

Overview

Watchdog timers are a safety mechanism used to increase the reliability of system such as a micro-controller or software program. They are essentially a free-running timer, independent of the process that it’s monitoring, and when the timer elapses, the watchdog resets the process. To prevent the watchdog from resetting the process, the process has to regularly reset (or ‘feed’) the watchdog. Thus the watchdog is a back-stop for code which locks up or becomes unresponsive.

A Simple Analog RC Watchdog Circuit

A simple watchdog can be made for a microcontroller using a resistor/capacitor network. Most microcontrollers have an active low reset pin (it needs to be pulled to ground for the device to be reset, and only comes out of reset once the pin rises back to Vcc). The following schematic shows the required components. It’s assumed the microcontroller reset has an internal pull-up resistor that can’t be disabled, hence the need for the N-Channel MOSFET to pull it low.

This circuit worked well with a 5ms on-pulse every 64ms. The on-pulse time could of probably have been reduced further, but I had no desire to tune it further. The exact voltages at which your particular microcontroller registers a logic high and logic low will influence the design, however the values above should work in most cases. An oscilloscope is really good to check the waveform and make sure the the voltage on the gate on U1 is not getting to close to the gate-source threshold voltage (at which point it turns on).

Posted: November 26th, 2018 at 8:46 am