Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************/
- /* Files to Include */
- /******************************************************************************/
- #if defined(__XC)
- #include <xc.h> /* XC8 General Include File */
- #elif defined(HI_TECH_C)
- #include <htc.h> /* HiTech General Include File */
- #endif
- #include <stdint.h> /* For uint8_t definition */
- #include <stdbool.h> /* For true/false definition */
- #include "user.h"
- #pragma config FOSC = INTOSCIO
- /******************************************************************************/
- /* User Functions */
- /******************************************************************************/
- /* <Initialize variables in user.h and insert code for user algorithms.> */
- void InitApp(void)
- {
- GIE = 1; //turn on general ints
- PEIE = 1; //turn on peripheral ints
- ADCON1 = 0b00000111; //turn AD pins to digital mode
- TRISA = 0x00; //set all of PORTA pins to output mode
- OSCCON = 0b01110100; //oscillator frequency settings
- T1CON = 0b00001100; //no prescaling, turn off external sync, oscillator on, internal clock, clock initially off
- TMR1IE = 1; //TIMER1 overflow interrupt enabled
- }
Advertisement
Add Comment
Please, Sign In to add comment