WDT MCU Reliability Utility

Watchdog Timer Calculator

Calculate watchdog timeout from oscillator frequency, prescaler and reload count, or find the closest watchdog prescaler and reload settings for a target timeout. Inspect watchdog tick rate, timeout error and recommended refresh intervals.

✓ Timeout ✓ Prescaler ✓ Reload ✓ WDT Tick ✓ Refresh Interval ✓ Error
WDT
Watchdog Timing Calculator
● Ready
Enter the watchdog oscillator or peripheral clock before the watchdog prescaler.
Actual divider, for example 4, 8, 16, 32, 64 or 256.
For +1 convention, reload 999 gives 1000 watchdog counts.
Use the convention documented for the target watchdog peripheral.
Clock feeding the watchdog prescaler.
Desired watchdog timeout.
Determines the maximum reload value.
Comma-separated integer dividers supported by the watchdog hardware.
Generic watchdog formula: Timeout = Counts × Prescaler / Watchdog Clock. If the watchdog reload register is zero-based, use Counts = Reload + 1. Some MCU watchdogs have additional fixed dividers, window restrictions or oscillator tolerances, so verify the final register interpretation against the MCU reference manual.
Watchdog Timer Result Calculated
Watchdog Configuration
Watchdog Timeout
Watchdog Clock
Prescaler Divider
Watchdog Tick
Tick Period
Reload Register
Total Counts
Target Timeout
Timeout Error
Error PPM
50% Refresh Point
75% Refresh Point
Calculation Breakdown

What Is a Watchdog Timer?

A watchdog timer is a hardware timer used to detect software that has stopped operating correctly. Application code periodically refreshes or services the watchdog. If that refresh does not occur before the timeout expires, the watchdog can generate a reset, interrupt or other recovery action.

The timeout is commonly derived from a low-speed oscillator, prescaler and counter or reload value.

Watchdog Timer Timeout Formula

Timeout = Counter Counts × Prescaler Divider ---------------------------------- Watchdog Source Clock

If the reload register is zero-based, the number of counts is typically reload plus one.

Watchdog Clock After Prescaler

Watchdog Tick Frequency = Source Clock ------------ Prescaler

For a 32 kHz source and divide-by-32 prescaler, the watchdog counter receives a 1 kHz clock.

32 kHz Watchdog Example

Source Clock: 32,000 Hz Prescaler: 32 Tick: 32,000 / 32 = 1000 Hz Reload: 999 Counts: 1000 Timeout: 1000 / 1000 = 1 second

Watchdog Reload Value

The reload value defines how many watchdog counter ticks can occur before the timeout event. On a zero-based watchdog counter, a register value of 999 corresponds to 1000 counts.

Reload: 999 Counts: 999 + 1 = 1000

Watchdog Prescaler

The prescaler slows the watchdog oscillator before it reaches the counter. Larger prescaler values increase the possible timeout but reduce the timing resolution of the watchdog counter.

Clock Prescaler Watchdog Tick
32 kHz48 kHz
32 kHz84 kHz
32 kHz162 kHz
32 kHz321 kHz
32 kHz64500 Hz
32 kHz256125 Hz

Watchdog Tick Period

The watchdog tick period is simply the reciprocal of the watchdog tick frequency.

Tick Frequency: 1000 Hz Tick Period: 1 / 1000 = 1 ms

Finding a Reload Value from a Target Timeout

If the watchdog clock and prescaler are known, the required count is:

Required Counts = Target Timeout × Source Clock ----------------------------- Prescaler

The result must be converted to an integer counter value supported by the hardware.

Watchdog Counter Width

Counter Width Maximum Register Zero-Based Counts
8-bit255256
12-bit40954096
16-bit65,53565,536
24-bit16,777,21516,777,216
32-bit4,294,967,2954,294,967,296

Watchdog Refresh Interval

Software normally refreshes the watchdog well before its timeout boundary. For a non-windowed watchdog, scheduling the refresh around a fraction of the timeout can provide margin for execution delays.

Watchdog Timeout: 2 seconds 50% point: 1 second 75% point: 1.5 seconds

The correct refresh strategy depends on the application’s worst-case timing and whether the watchdog includes a minimum refresh window.

Window Watchdog vs Independent Watchdog

A basic independent watchdog typically requires servicing before a maximum timeout. A window watchdog can additionally reject servicing that occurs too early.

This calculator handles the fundamental timeout, prescaler and reload mathematics. A dedicated window calculation also requires the watchdog’s minimum allowed refresh point.

Watchdog Oscillator Tolerance

Many watchdog timers use low-speed internal oscillators whose frequency can have significant tolerance across voltage and temperature. A nominal 32 kHz watchdog source may therefore not operate at exactly 32,000 Hz on every device.

For safety-critical timeout design, calculate both the fastest and slowest possible timeout using the oscillator limits from the microcontroller datasheet.

Watchdog Timeout Error

When finding settings for a requested timeout, integer reload values and a limited set of prescaler dividers can prevent an exact match.

Error = Actual Timeout - Target Timeout

The calculator tests all supplied prescaler choices and chooses the closest valid result.

Watchdog Timer Calculator FAQs

How do I calculate watchdog timeout?
Multiply watchdog counter counts by the prescaler divider and divide by the watchdog source clock.
What does a watchdog prescaler do?
It divides the watchdog source clock so the watchdog counter advances more slowly and can produce longer timeouts.
Why does reload sometimes use +1?
A zero-based counter includes count zero, so a register value of 999 can represent 1000 counter intervals.
What is a watchdog refresh?
It is the software operation that reloads or services the watchdog before the timeout expires.
What happens when the watchdog expires?
Depending on the hardware, expiration can cause a processor reset, interrupt or another recovery action.
Should the watchdog be refreshed exactly at the timeout?
No. Normally it is serviced with adequate margin before the deadline, subject to any window-watchdog restrictions.
Why can the actual watchdog timeout differ from my calculation?
The watchdog oscillator may have frequency tolerance, and the device may use additional fixed dividers or implementation-specific counting rules.
What is a window watchdog?
A window watchdog requires servicing within an allowed time window rather than simply any time before the maximum timeout.
Can this calculator find the best prescaler?
Yes. Use Find WDT Settings and enter the prescaler dividers supported by your hardware.
Does this calculator replace the MCU reference manual?
No. It calculates generic watchdog timing. Always verify fixed dividers, register ranges, oscillator tolerances and watchdog behavior in the actual device documentation.

Calculate Watchdog Timeout and Reload Settings

Convert watchdog oscillator frequency, prescaler and reload values into timeout timing, or find the closest hardware settings for a target MCU watchdog interval.

Scroll to Top