5.7.2 Watchdog Timer (WDT)
The PIC16F, PIC18F 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. The PIC16F, PIC18F, and PIC32CM WDTs support normal and window (WWDT) modes, where the WDT must be cleared within a specific time window to avoid a system reset.
The following table provides a comparison of features of the PIC16F, PIC18F, and PIC32CM.
| Feature | PIC16F WDT/WWDT | PIC18F WDT/WWDT | PIC32CM WDT/WWDT |
|---|---|---|---|
| Operation | Asynchronous | Asynchronous | Asynchronous |
| Clock Source |
Selectable: LFINTOSC (31 kHz), MFINTOSC (31.25/500 kHz), or SOSC |
Selectable: LFINTOSC (31 kHz), MFINTOSC (31.25/500 kHz), or SOSC | Dedicated internal oscillator |
| Window Mode | Supported | Supported | Supported |
| Time-out Periods | From 1 ms up to 256 seconds | From 1 ms to 256 seconds | Normal: 8 to 16,384 cycles Windowed: 16 to 32,768 cycles |
| Early Warning Interrupt | N/A | N/A | Supported |
| Always-On Capability | Supported | Supported | Supported |
| Configuration (Change) Protection | Supported | Supported | Supported |
| Operation in Sleep Modes | Supported | Supported | Supported |
| Reset Action | Triggers a System Reset on timeout or window violation | Asserts a hardware device Reset | System reset on time-out or window violation |
| Interrupt on Timeout | Supported | Supported | Supported (early warning) |
| Runtime Enable/Disable | Supported | Supported | Supported |
