4.7.17 Configuration Bits

Configuration bits (also known as fuses) can be configured using one of two methods:

#pragma config CP0=OFF,OSCS=ON,OSC=LP,BOR=ON,BORV=25,WDT=ON,WDTPS=128,CCP2MUX=ON

#pragma config STVR=ON

#include <pic18fregs.h> //Contains config addresses and options 
 
static __code char __at(__CONFIG1L) configword1l = 
  _USBPLL_CLOCK_SRC_FROM_96MHZ_PLL_2_1L &

  _PLLDIV_NO_DIVIDE__4MHZ_INPUT__1L & [...]; 
static __code char __at(__CONFIG1H) configword1h = [...]; 
static __code char __at(__CONFIG2L) configword2l = [...]; 
//More configuration words

Mixing both methods is not allowed and throws an error message ”mixing __CONFIG and CONFIG directives”.