Here I did this today for some one else
But read the data sheet to make sure there mostly the same but read yours and use this to see what you set
The data sheet tell you starting at bit 0 you want
0 at bit 0 Oscillator Selection bits
0 at bit 1 Oscillator Selection bits
0 at bit 2 0 = WDT disabled
0 at bit 3 0 = PWRT enabled
1 at bit 4 Oscillator Selection bits
0 at bit 5 0 = RA5/MCLR/VPP pin function is digital Input, MCLR internally tied to VDD
0 at bit 6 0 = BOR Reset disabled a 1 if you need this
0 at bit 7 0 = RB4/PGM is digital I/O, HV on MCLR must be used for programming++
1 at bit 8 1 = Data memory code protection off you sure want this a 1
0 at bit 9 Unimplemented: Read as ‘0’
0 at bit 10 Unimplemented: Read as ‘0’
0 at bit 11 Unimplemented: Read as ‘0’
0 at bit 12 Unimplemented: Read as ‘0’
1 at bit 13 1 = Code protection off
But if you can i would set it like this
Code:
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _RC_OSC & _WRT_OFF & _LVP_ON & _CPD_OFF
Less chance of setting wrong this way