3 /* configword.c - illustrates how the configuration word can
6 unsigned char success=0;
7 unsigned char failures=0;
10 /* copied from 16f877.inc file supplied with gpasm */
12 #define _CP_ALL 0x0FCF
13 #define _CP_HALF 0x1FDF
14 #define _CP_UPPER_256 0x2FEF
15 #define _CP_OFF 0x3FFF
16 #define _DEBUG_ON 0x37FF
17 #define _DEBUG_OFF 0x3FFF
18 #define _WRT_ENABLE_ON 0x3FFF
19 #define _WRT_ENABLE_OFF 0x3DFF
20 #define _CPD_ON 0x3EFF
21 #define _CPD_OFF 0x3FFF
22 #define _LVP_ON 0x3FFF
23 #define _LVP_OFF 0x3F7F
24 #define _BODEN_ON 0x3FFF
25 #define _BODEN_OFF 0x3FBF
26 #define _PWRTE_OFF 0x3FFF
27 #define _PWRTE_ON 0x3FF7
28 #define _WDT_ON 0x3FFF
29 #define _WDT_OFF 0x3FFB
30 #define _LP_OSC 0x3FFC
31 #define _XT_OSC 0x3FFD
32 #define _HS_OSC 0x3FFE
33 #define _RC_OSC 0x3FFF
35 typedef unsigned int word;
37 word at 0x2007 CONFIG = _WDT_OFF & _PWRTE_ON;
40 /* to do -- write a test that puts the PIC to sleep,
41 * and verify that the WDT wakes it up */