

#pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled)

#pragma config MCLRE = ON // MCLR Pin Function Select (MCLR/VPP pin function is MCLR) #pragma config PWRTE = OFF // Power-up Timer Enable (PWRT disabled)

#pragma config WDTE = ON // Watchdog Timer Enable (WDT enabled) #pragma config FOSC = ECH // Oscillator Selection Bits (ECH, External Clock, High Power Mode (4-20 MHz): device clock supplied to CLKIN pins) Then it opens a window which Cyclops answer shows, then if you click on Generate source code it will generate a file that you can add to your project, it is some thing like: // PIC16F1459 Configuration Bit Settings If you just installed fresh MPLAB X IDE v5.35 and XC8 compiler and you need a tool to set those bits, Configuration Bits tool is in the : _CONFIG(WRT_OFF & VCAPEN_OFF & PLLEN_OFF & STVREN_OFF & LVP_OFF) Ĭomparing this with the above header file you can see what each configuration macro will enable/disable. High-voltage on MCLR/VPP must be used for programmingĪn example in the previously quoted document is: _CONFIG(FOSC_INTOSC &WDTE_OFF & PWRTE_OFF & MCLRE_ON& CP_OFF & BOREN_OFF & CLKOUTEN_ON & IESO_OFF & FCMEN_OFF) Brown-out Reset Voltage (VBOR) set to 2.7V Brown-out Reset Voltage (VBOR) set to 1.9V Stack Overflow or Underflow will not cause a Reset Stack Overflow or Underflow will cause a Reset 000h to 1FFFh write protected, no addresses may be modified by EECON control 000h to FFFh write protected, 1000h to 1FFFh may be modified by EECON control 000h to 1FFh write protected, 200h to 1FFFh may be modified by EECON control Internal/External Switchover mode is disabled Internal/External Switchover mode is enabled CLKOUT function is enabled on the CLKOUT pin I/O or oscillator function on the CLKOUT pin Brown-out Reset controlled by the SBOREN bit in the BORCON register Brown-out Reset enabled while running and disabled in Sleep Data memory code protection is enabled Data memory code protection is disabled Program memory code protection is enabled Program memory code protection is disabled MCLR/VPP pin function is digital input WDT controlled by the SWDTEN bit in the WDTCON register WDT enabled while running and disabled in Sleep LP Oscillator, Low-power crystal connected between OSC1 and OSC2 pins XT Oscillator, Crystal/resonator connected between OSC1 and OSC2 pins HS Oscillator, High-speed crystal/resonator connected between OSC1 and OSC2 pins EXTRC oscillator: External RC circuit connected to CLKIN pin INTOSC oscillator: I/O function on CLKIN pin ECL, External Clock, Low Power Mode (0-0.5 MHz): device clock supplied to CLKIN pin ECM, External Clock, Medium Power Mode (0.5-4 MHz): device clock supplied to CLKIN pin ECH, External Clock, High Power Mode (4-32 MHz): device clock supplied to CLKIN pin If we look in the header file for your particular chip we find: /
MPLAB XC8 SETTING CONFIG MANUAL
Microchip's website has a document named Using the right Format, Syntax and Definitions for PICmicro Configuration Bits that explains where to find the configuration settings for your particular device.įor example it states for the PIC16F1 devices with a C Compiler:įormat: Defined in the User Manual Located at:Ĭ:\Program Files\HI‐TECH Software\PICC\\docs\ĭefinition/Syntax: Located in respective product's header file.
