AdvancedTopic 75 of 104Electronics & Embedded

Watchdog timers

Reset the system if software stops responding.

In depth

A watchdog timer resets the MCU unless software kicks it periodically, recovering from hangs. Window watchdogs also catch too-fast kicking. Kick only from a healthy supervisory task, not an ISR. Independent oscillator makes it robust.

Key points

  • Timeout selection
  • Reset reason register
  • Safety standards require it
Example

If the main loop deadlocks, the watchdog reboots the device.

Why it matters

Watchdog timers reset a stuck system automatically, which is an important safety feature in remote and safety-related products.

Where this is used

  • Resetting a remote sensor that freezes after an unexpected input.
  • Protecting a motor controller from software lock-up.
  • Recovering a medical device from a fault without a user needing to intervene.

Frequently asked questions

What is Watchdog timers?

Reset the system if software stops responding.

Why is it important to understand watchdog timers?

Watchdog timers reset a stuck system automatically, which is an important safety feature in remote and safety-related products.

How does a watchdog work?

Software must regularly refresh the timer, and if it stops refreshing, the timer expires and resets the processor.

What is a window watchdog?

A watchdog that must be refreshed only within a set time window, which catches software that runs too fast as well as software that stops.

How is Watchdog timers used in practice?

Typical applications include resetting a remote sensor that freezes after an unexpected input, protecting a motor controller from software lock-up and recovering a medical device from a fault without a user needing to intervene.

What should I learn before Watchdog timers?

Study "Power management" first (topic 74 of 104 in Electronics & Embedded). It covers the groundwork this topic builds on.

What are the key points of Watchdog timers?

Timeout selection. Reset reason register. Safety standards require it.

Can you give an example of Watchdog timers?

If the main loop deadlocks, the watchdog reboots the device.

What comes after Watchdog timers?

The next topic is "Debugging tools", which builds directly on this one.

How difficult is Watchdog timers?

It is classed as Advanced in Electronics & Embedded (topic 75 of 104). It is an advanced topic. It assumes you are comfortable with the intermediate topics in Electronics & Embedded.

Learning path

Want to practise? Open the interactive course for quick checks, quizzes, simulations and progress tracking.

Related topics