33.8.3 Configuring WDT Via Config Fuse

WDT Configuration Example shows a code example to configure Run and Sleep WDT for 1.024 sec with LPRC as a Run WDT clock source via config fuse.

WDT Configuration Example

//code example to configure Run and Sleep WDT for 1.024 sec via config 
//fuse 
// FWDT
#pragma config FWDT_WINDIS = OFF       // Watchdog Timer Window Disable bit (Watchdog Timer operates in Window mode)
#pragma config FWDT_SWDTMPS = PS1024   // Sleep Mode Watchdog Timer Post Scaler select bits (1:1024)
#pragma config FWDT_RCLKSEL = BPRC256  // Watchdog Timer Clock select bits (WDT Run Mode uses BFRC:256)
#pragma config FWDT_RWDTPS = PS1024    // Run Mode Watchdog Timer Post Scaler select bits (1:1024)
#pragma config FWDT_WDTWIN = WIN25     // Watchdog Timer Window Size Select bits (WDT Window is 25% of WDT period)
#pragma config FWDT_WDTEN = SW         // Watchdog Timer Enable bit (WDT is controlled by software, use WDTCON.ON bit)
#pragma config FWDT_WDTRSTEN = ON      // Watchdog Timer Reset Enable bit (WDT event generates a reset)