/******************************************************************************/ /* Main Files to Include */ /******************************************************************************/ #if defined(__XC) #include /* XC8 General Include File */ #elif defined(HI_TECH_C) #include /* HiTech General Include File */ #endif /******************************************************************************/ /* Configuration Bits */ /* */ /* Refer to your Hi-Tech User Manual in the PICC installation directory */ /* /doc folder for more information on filling in configuration bits. */ /* In addition, configuration bit mnemonics can be found in your */ /* PICC\version\include\.h file for your device. The XC8 */ /* compiler contains documentation on the configuration bit macros within */ /* the compiler installation /docs folder in a file called */ /* pic18_chipinfo.html. */ /* */ /* For additional information about what the hardware configurations mean in */ /* terms of device operation, refer to the device datasheet. */ /* */ /* A feature of MPLAB X is the 'Generate Source Code to Output' utility in */ /* the Configuration Bits window. Under Window > PIC Memory Views > */ /* Configuration Bits, a user controllable configuration bits window is */ /* available to Generate Configuration Bits source code which the user can */ /* paste into this project. */ /* */ /******************************************************************************/ // PIC12F1840 Configuration Bit Settings // CONFIG1 #pragma config FOSC = INTOSC // Oscillator Selection (INTOSC oscillator: I/O function on CLKIN pin) #pragma config WDTE = SWDTEN // Watchdog Timer Enable (WDT software enabled) #pragma config PWRTE = OFF // Power-up Timer Enable (PWRT disabled) #pragma config MCLRE = OFF // MCLR Pin Function Select (MCLR/VPP pin function is digital input) #pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled) #pragma config CPD = OFF // Data Memory Code Protection (Data memory code protection is disabled) #pragma config BOREN = ON // Brown-out Reset Enable (Brown-out Reset enabled) #pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin) #pragma config IESO = OFF // Internal/External Switchover (Internal/External Switchover mode is disabled) #pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is enabled) // CONFIG2 #pragma config WRT = OFF // Flash Memory Self-Write Protection (Write protection off) #pragma config PLLEN = ON // PLL Enable (4x PLL enabled) #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will cause a Reset) #pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), low trip point selected.) #pragma config LVP = ON // Low-Voltage Programming Enable (Low-voltage programming enabled)