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