How a watchdog timer works
A watchdog timer is an independent counter that counts down from a set value. While the software is healthy, it restarts the count at regular intervals, which engineers call kicking, petting or feeding the watchdog. If a crash, an endless loop or a driver fault stops the software doing that, the counter reaches zero and the watchdog acts, usually by resetting the processor.
The point is that the watchdog does not rely on the software it is watching. It runs from its own clock in separate hardware, so it still works when the operating system has frozen solid. A system that hangs at 3 a.m. at an unmanned pumping station is running again within minutes, without a site visit.
Watchdogs are as old as embedded computing. Spacecraft, car engine controllers and pacemakers all rely on them, and almost every microcontroller and industrial PC has at least one built in.
Hardware vs software watchdogs
A hardware watchdog is a physical timer outside the main software: a peripheral in a microcontroller, a separate supervisor chip, the Super I/O controller or chipset on a PC board, or the baseboard management controller on a server. It can reset the system even if the processor itself has locked up.
A software watchdog is a program or operating system feature that watches other programs. On Linux, systemd can restart a service that stops checking in, and the kernel can detect a stalled CPU. Software watchdogs are good at catching a single failed application, but they cannot help if the kernel or hardware hangs.
In practice the two are layered. Systemd watches the applications and feeds the hardware watchdog through the Linux watchdog driver. If the whole system hangs, the feeding stops and the hardware resets the machine.
Types of watchdog and where they live
Watchdogs vary in how strictly they judge the software, from a simple timeout to checks that the code is running in the right order.
| Type | Where it lives | What it catches | Typical use |
|---|---|---|---|
| Timeout watchdog | Microcontroller peripheral or PC Super I/O | Software that stops kicking it | Most embedded systems and industrial PCs |
| Windowed watchdog | Microcontroller or external supervisor chip | Kicks that come too late or too early | Automotive and safety-related control |
| Question-and-answer watchdog | External safety supervisor | Wrong program flow as well as timing | Functional safety designs such as ISO 26262 systems |
| Multistage watchdog | Microcontroller, PC chipset or BMC | Hangs, with a warning stage before reset | Logging the fault, then resetting |
| BMC watchdog | Baseboard management controller | Host hangs, including at boot | Servers and edge servers |
| Software watchdog | Operating system, such as systemd | Individual services that stall | Restarting one application |
A windowed watchdog matters because a runaway program can sometimes kick a simple watchdog by accident. Requiring the kick to land inside a time window, or to carry the right answer to a challenge, makes that much less likely.
Watchdogs on industrial and embedded computers
On x86 industrial boards, the watchdog usually sits in the Super I/O chip or the chipset and is programmable from about 1 to 255 seconds, or in minutes on some boards. It is enabled in the BIOS or UEFI setup, then fed by a driver or the manufacturer’s utility under Windows or Linux. Many of our industrial motherboards and fanless PCs list a hardware watchdog in their specifications. Servers and edge servers add a second watchdog in the baseboard management controller, which runs independently of the host.
A watchdog earns its place wherever nobody is on hand to press a reset button:
-
//
Signage and kiosks. Digital signage players and self-service kiosks in public spaces, where a frozen screen is visible to everyone.
-
//
Remote and utility sites. Telemetry, substation and pipeline computers in cabinets hours from the nearest engineer.
-
//
Control cabinets. DIN rail PCs running gateways, data collection and machine control beside PLCs.
-
//
Vehicles and rail. On-board computers that must recover from a brownout or a hung driver while the vehicle is in service.
Setting the watchdog timeout
The timeout has to be longer than the slowest normal gap between kicks, including boot time and heavy-load moments, or the watchdog will reset a healthy system. It should still be short enough that a real hang is cleared quickly. Disable or extend it during firmware and operating system updates, and log every watchdog reset so a recurring fault is investigated rather than hidden.
Feed the watchdog from a point that proves the whole application is healthy, not from a separate thread that keeps running when the main work has stalled. On a vision or control system, that usually means kicking it only after each processing cycle completes. Test the setting by deliberately hanging the system before it goes into service.
Quick answers on watchdog timers
Watchdog timers: common questions
What is a watchdog timer in a microcontroller?
A built-in peripheral that resets the chip if firmware stops responding. The firmware clears the timer from its main loop. If the loop stalls, the timer overflows and the microcontroller restarts.
What happens when a watchdog timer expires?
Usually a full system reset. Some watchdogs first raise an interrupt so the software can log the fault, then reset if the system still does not respond.
What is a typical watchdog timeout?
Milliseconds on microcontrollers, seconds on PCs. Industrial PCs typically offer 1 to 255 seconds. Pick a value comfortably above the longest normal pause, including boot.
Is a Windows DPC watchdog violation the same thing?
No. DPC watchdog violation and clock watchdog timeout are Windows stop errors raised by the operating system’s own checks, usually because of a faulty driver. They are not the hardware watchdog timer.
Can a watchdog cause a reboot loop?
Yes, if the timeout is too short. When the system cannot finish booting and start feeding the watchdog in time, it resets again and again. Lengthen the timeout or start the feeding earlier.
We enable and set the hardware watchdog to suit your software as standard when we configure industrial and embedded computers, alongside the operating system image and drivers.