5.7.2 Watchdog Timer (WDT)
AVR and PIC32CM MCUs feature a Watchdog Timer (WDT) to monitor program execution and recover from software faults such as runaway or deadlocked code. The WDT operates asynchronously from a dedicated, CPU-independent clock source, ensuring it functions even if the main clock fails. Both the AVR and PIC32CM WDTs support normal and window modes, in which the WDT must be cleared within a specific time window to avoid a system reset.
Some AVR devices also include a Synchronous WDT (SWDT) in addition to the standard WDT for safety-critical applications where software functionality and sequencing failures must be detected.
Table 5-28 shows a comparison of features between AVR and PIC32CM.
| Feature/Aspect | AVR® WDT/SWDT | PIC32CM WDT |
|---|---|---|
| Operation |
Varies per device family: Asynchronous (WDT) Synchronous (SWDT) | Asynchronous |
| Clock Source |
WDT: OSC32K, 1.024 kHz SWDT: CLK_PER | Dedicated internal oscillator |
| Window Mode | Supported | Supported |
| Time-out Periods |
WDT: 8 ms to 8s SWDT: 24-bit value |
Normal: 8 to 16,384 cycles Windowed: 16 to 32,768 cycles |
| Early Warning Interrupt | SWDT: Supported | Supported |
| Always-On Capability | Supported | Supported |
| Configuration (Change) Protection | Supported | Supported |
| Operation in Sleep Modes | Supported | Supported |
| Test/Functional Safety | SWDT: Supported | N/A |
| Reset Action | System reset on time-out or window violation | System reset on time-out or window violation |
| Interrupt on Timeout | SWDT: Supported | Supported (early warning) |
