SPRUHZ7K August 2015 – April 2024 AM5706 , AM5708 , AM5716 , AM5718 , AM5718-HIREL
The watchdog timer is composed of a prescaler stage and a timer counter.
The timer rate is defined by the following values:
The prescaler stage is clocked with the timer clock and acts as a clock divider for the timer counter stage. The ratio is managed by accessing the ratio definition field (the WCLR [4:2] PTV bit field) and is enabled with the WCLR[5] PRE bit.
Table 22-68 lists the prescaler clock ratio values.
WCLR[5] PRE | WCLR[4:2] PTV | Clock Divider (PS) |
---|---|---|
0 | X | 1 |
1 | 0 | 1 |
1 | 1 | 2 |
1 | 2 | 4 |
1 | 3 | 8 |
1 | 4 | 16 |
1 | 5 | 32 |
1 | 6 | 64 |
1 | 7 | 128 |
Thus the watchdog timer overflow rate is expressed as:
OVF_Rate = (0xFFFF FFFF – WLDR + 1) × (timer clock period) × PS
where wd-functional clock period = 1 / (timer clock frequency) and PS = 2(PTV)
Internal resynchronization causes some latency in any software write to WSPR before WSPR is updated with the programmed value:
1.5 × functional clock cycles ≤ write_WD_TIMER_WSPR_latency ≤ 2.5 × functional clock cycles
Remember to consider this latency whenever the watchdog timer must be started or stopped.
For example, for a timer clock input of 32 kHz with a prescaler ratio value of 0x1 (clock divided by 2) and WCLR[5] PRE = 1 (clock divider enabled), the reset period is as listed in Table 22-69.
WLDR Value | Reset Period |
---|---|
0x0000 0000 | 74 h 56 min |
0xFFFF 0000 | 4 s |
0xFFFF FFF0 | 1 ms |
0xFFFF FFFF | 62.5 µs |
Table 22-70 lists the default reset periods for the watchdog timer.
Watchdog Timers | Clock Source | Default Reset Period |
---|---|---|
WD_TIMER2 | 32 kHz | 10 s |