MPC - Setting Configuration Fuses

MPC

Here is an example of setting configuration fuses on the PIC16Cxx using the #pragma __CONFIG directive: All configuration parameters are ORed together:

 /* This example works with all members of the PIC14Cxx
    and 16C5x/6x/7x/8x. It does not work, however, with
    the 17Cxx family. */
	
/* Configuration word settings */

#define LP_OSC       0b00000000  /* Low power crystal */
#define XT_OSC       0b00000001  /* Crystal */
#define HS_OSC       0b00000010  /* High Speed crystal */
#define RC_OSC       0b00000011  /* RC Oscillator */
#define WDTE         0b00000100  /* Enable WDT */
#define PWRTE        0b00001000  /* Enable power-up time */
#define CP_UPR_1_2   0b00100000  /* Protect upper half */
#define CP_UPR_3_4   0b00010000  /* Protect upper 3/4 */
#define CP_OFF       0b00110000  /* Code protection off */
#pragma __CONFIG @ 0x2007 = RC_OSC | WDTE | CP_OFF | PWRTE;

#include <16c71.h>
void main(void) { }