/******************************************************************************/ /* Files to Include */ /******************************************************************************/ #include /* For uint8_t definition */ #include /* For true/false definition */ #include "user.h" /******************************************************************************/ /* User Functions */ /******************************************************************************/ /* */ void InitApp(void) { // set oscillator to 32MHz OSCCONbits.SCS = 0b00; OSCCONbits.IRCF = 0b1110; OSCCONbits.SPLLEN = 1; // Turn watchdog on at 16 seconds WDTCONbits.WDTPS = 0b01110; // Button on RA2 OPTION_REGbits.nWPUEN = 0; TRISAbits.TRISA1 = 1; ANSELAbits.ANSA1 = 0; WPUAbits.WPUA1 = 1; }