Adafruit iconAdafruitSep 4, 2026 ~2 min source read

CircuitPython Watchdog Module: How to detect and recover from stalled microcontroller code

Adafruit published a new Learn guide explaining CircuitPython’s watchdog module: what it does, how to configure it, which devices support it, and copy‑paste examples you can use to protect deployed hardware from freezes.

Share this story

Send the public story page.

Useful takeaways from this story.

The Learn guide lists which ports and chips support watchdog features and gives configuration and example code so you can add watchdog protection to projects quickly.

# What the watchdog module does

The CircuitPython watchdog module provides a simple watchdog timer for microcontrollers. Configure a timeout, activate the watchdog, and then ensure your code calls the feed method at least once within each timeout period. If your program fails to feed the watchdog before the timeout elapses, the watchdog triggers a reset to bring the device back to a clean state.

# Why you'd use it

# What the guide covers

The new Adafruit Learn guide covers:

  • Which CircuitPython ports and microcontroller families support watchdog functionality. The article's tags include Espressif, Nordic, RP2040, and RP2350, indicating the guide addresses those platforms.
  • Practical code examples you can copy into your projects to add watchdog behavior.

# Practical usage notes

# Examples and copying code

The guide includes ready‑to‑use code examples. Use those examples to test the behavior on your specific board before deploying: enable the watchdog with a clear timeout, then simulate a stall to confirm the reset sequence works as expected.

# Community and follow‑up resources

Adafruit invites makers to share projects and join their community channels. Weekly events mentioned in the post include Electronics Show and Tell and Ask an Engineer. Adafruit's Discord is listed as an active community hub where you can ask questions about applying watchdogs to your hardware.

# Quick checklist for adding a watchdog

  • Confirm your target board's CircuitPython port supports the watchdog module.
  • Choose an appropriate timeout based on worst‑case delays in your system.
  • Insert feed calls in healthy execution paths or a supervisory loop.
  • Test by intentionally stalling code to confirm the watchdog resets the device.
  • Handle post‑reset initialization and any required recovery logic.

# Bottom line

More context around this story.

Loading more related stories...

Keep reading in the app

Open the app view to save this story, compare related coverage, and continue from the same source.

Open in app