1 /******************************************************************************/
3 /******************************************************************************/
6 #include <stdint.h> /* For uint8_t definition */
7 #include <stdbool.h> /* For true/false definition */
11 /******************************************************************************/
13 /******************************************************************************/
15 /* <Initialize variables in user.h and insert code for user algorithms.> */
19 // set oscillator to 32MHz
20 OSCCONbits.SCS = 0b00;
21 OSCCONbits.IRCF = 0b1110;
22 OSCCONbits.SPLLEN = 1;
24 // Turn watchdog on at 16 seconds
25 WDTCONbits.WDTPS = 0b01110;
28 OPTION_REGbits.nWPUEN = 0;