2 * This declarations of the PIC16F887 MCU.
4 * This file is part of the GNU PIC library for SDCC, originally
5 * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
7 * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:01 UTC.
9 * SDCC is licensed under the GNU Public license (GPL) v2. Note that
10 * this license covers the code to the compiler and other executables,
11 * but explicitly does not cover any code or objects generated by sdcc.
13 * For pic device libraries and header files which are derived from
14 * Microchip header (.inc) and linker script (.lkr) files Microchip
15 * requires that "The header files should state that they are only to be
16 * used with authentic Microchip devices" which makes them incompatible
17 * with the GPL. Pic device libraries and header files are located at
18 * non-free/lib and non-free/include directories respectively.
19 * Sdcc should be run with the --use-non-free command line option in
20 * order to include non-free header files and libraries.
22 * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
25 #ifndef __PIC16F887_H__
26 #define __PIC16F887_H__
28 //==============================================================================
32 //==============================================================================
34 #ifndef NO_ADDR_DEFINES
36 #define INDF_ADDR 0x0000
37 #define TMR0_ADDR 0x0001
38 #define PCL_ADDR 0x0002
39 #define STATUS_ADDR 0x0003
40 #define FSR_ADDR 0x0004
41 #define PORTA_ADDR 0x0005
42 #define PORTB_ADDR 0x0006
43 #define PORTC_ADDR 0x0007
44 #define PORTD_ADDR 0x0008
45 #define PORTE_ADDR 0x0009
46 #define PCLATH_ADDR 0x000A
47 #define INTCON_ADDR 0x000B
48 #define PIR1_ADDR 0x000C
49 #define PIR2_ADDR 0x000D
50 #define TMR1_ADDR 0x000E
51 #define TMR1L_ADDR 0x000E
52 #define TMR1H_ADDR 0x000F
53 #define T1CON_ADDR 0x0010
54 #define TMR2_ADDR 0x0011
55 #define T2CON_ADDR 0x0012
56 #define SSPBUF_ADDR 0x0013
57 #define SSPCON_ADDR 0x0014
58 #define CCPR1_ADDR 0x0015
59 #define CCPR1L_ADDR 0x0015
60 #define CCPR1H_ADDR 0x0016
61 #define CCP1CON_ADDR 0x0017
62 #define RCSTA_ADDR 0x0018
63 #define TXREG_ADDR 0x0019
64 #define RCREG_ADDR 0x001A
65 #define CCPR2_ADDR 0x001B
66 #define CCPR2L_ADDR 0x001B
67 #define CCPR2H_ADDR 0x001C
68 #define CCP2CON_ADDR 0x001D
69 #define ADRESH_ADDR 0x001E
70 #define ADCON0_ADDR 0x001F
71 #define OPTION_REG_ADDR 0x0081
72 #define TRISA_ADDR 0x0085
73 #define TRISB_ADDR 0x0086
74 #define TRISC_ADDR 0x0087
75 #define TRISD_ADDR 0x0088
76 #define TRISE_ADDR 0x0089
77 #define PIE1_ADDR 0x008C
78 #define PIE2_ADDR 0x008D
79 #define PCON_ADDR 0x008E
80 #define OSCCON_ADDR 0x008F
81 #define OSCTUNE_ADDR 0x0090
82 #define SSPCON2_ADDR 0x0091
83 #define PR2_ADDR 0x0092
84 #define MSK_ADDR 0x0093
85 #define SSPADD_ADDR 0x0093
86 #define SSPMSK_ADDR 0x0093
87 #define SSPSTAT_ADDR 0x0094
88 #define WPUB_ADDR 0x0095
89 #define IOCB_ADDR 0x0096
90 #define VRCON_ADDR 0x0097
91 #define TXSTA_ADDR 0x0098
92 #define SPBRG_ADDR 0x0099
93 #define SPBRGH_ADDR 0x009A
94 #define PWM1CON_ADDR 0x009B
95 #define ECCPAS_ADDR 0x009C
96 #define PSTRCON_ADDR 0x009D
97 #define ADRESL_ADDR 0x009E
98 #define ADCON1_ADDR 0x009F
99 #define WDTCON_ADDR 0x0105
100 #define CM1CON0_ADDR 0x0107
101 #define CM2CON0_ADDR 0x0108
102 #define CM2CON1_ADDR 0x0109
103 #define EEDAT_ADDR 0x010C
104 #define EEDATA_ADDR 0x010C
105 #define EEADR_ADDR 0x010D
106 #define EEDATH_ADDR 0x010E
107 #define EEADRH_ADDR 0x010F
108 #define SRCON_ADDR 0x0185
109 #define BAUDCTL_ADDR 0x0187
110 #define ANSEL_ADDR 0x0188
111 #define ANSELH_ADDR 0x0189
112 #define EECON1_ADDR 0x018C
113 #define EECON2_ADDR 0x018D
115 #endif // #ifndef NO_ADDR_DEFINES
117 //==============================================================================
119 // Register Definitions
121 //==============================================================================
123 extern __at(0x0000) __sfr INDF
;
124 extern __at(0x0001) __sfr TMR0
;
125 extern __at(0x0002) __sfr PCL
;
127 //==============================================================================
130 extern __at(0x0003) __sfr STATUS
;
154 extern __at(0x0003) volatile __STATUSbits_t STATUSbits
;
165 //==============================================================================
167 extern __at(0x0004) __sfr FSR
;
169 //==============================================================================
172 extern __at(0x0005) __sfr PORTA
;
186 extern __at(0x0005) volatile __PORTAbits_t PORTAbits
;
197 //==============================================================================
200 //==============================================================================
203 extern __at(0x0006) __sfr PORTB
;
217 extern __at(0x0006) volatile __PORTBbits_t PORTBbits
;
228 //==============================================================================
231 //==============================================================================
234 extern __at(0x0007) __sfr PORTC
;
248 extern __at(0x0007) volatile __PORTCbits_t PORTCbits
;
259 //==============================================================================
262 //==============================================================================
265 extern __at(0x0008) __sfr PORTD
;
279 extern __at(0x0008) volatile __PORTDbits_t PORTDbits
;
290 //==============================================================================
293 //==============================================================================
296 extern __at(0x0009) __sfr PORTE
;
319 extern __at(0x0009) volatile __PORTEbits_t PORTEbits
;
326 //==============================================================================
328 extern __at(0x000A) __sfr PCLATH
;
330 //==============================================================================
333 extern __at(0x000B) __sfr INTCON
;
362 extern __at(0x000B) volatile __INTCONbits_t INTCONbits
;
375 //==============================================================================
378 //==============================================================================
381 extern __at(0x000C) __sfr PIR1
;
395 extern __at(0x000C) volatile __PIR1bits_t PIR1bits
;
405 //==============================================================================
408 //==============================================================================
411 extern __at(0x000D) __sfr PIR2
;
417 unsigned ULPWUIF
: 1;
425 extern __at(0x000D) volatile __PIR2bits_t PIR2bits
;
428 #define _ULPWUIF 0x04
435 //==============================================================================
437 extern __at(0x000E) __sfr TMR1
;
438 extern __at(0x000E) __sfr TMR1L
;
439 extern __at(0x000F) __sfr TMR1H
;
441 //==============================================================================
444 extern __at(0x0010) __sfr T1CON
;
452 unsigned NOT_T1SYNC
: 1;
453 unsigned T1OSCEN
: 1;
454 unsigned T1CKPS0
: 1;
455 unsigned T1CKPS1
: 1;
464 unsigned T1INSYNC
: 1;
492 extern __at(0x0010) volatile __T1CONbits_t T1CONbits
;
496 #define _NOT_T1SYNC 0x04
497 #define _T1INSYNC 0x04
499 #define _T1OSCEN 0x08
500 #define _T1CKPS0 0x10
501 #define _T1CKPS1 0x20
506 //==============================================================================
508 extern __at(0x0011) __sfr TMR2
;
510 //==============================================================================
513 extern __at(0x0012) __sfr T2CON
;
519 unsigned T2CKPS0
: 1;
520 unsigned T2CKPS1
: 1;
522 unsigned TOUTPS0
: 1;
523 unsigned TOUTPS1
: 1;
524 unsigned TOUTPS2
: 1;
525 unsigned TOUTPS3
: 1;
543 extern __at(0x0012) volatile __T2CONbits_t T2CONbits
;
545 #define _T2CKPS0 0x01
546 #define _T2CKPS1 0x02
548 #define _TOUTPS0 0x08
549 #define _TOUTPS1 0x10
550 #define _TOUTPS2 0x20
551 #define _TOUTPS3 0x40
553 //==============================================================================
555 extern __at(0x0013) __sfr SSPBUF
;
557 //==============================================================================
560 extern __at(0x0014) __sfr SSPCON
;
583 extern __at(0x0014) volatile __SSPCONbits_t SSPCONbits
;
594 //==============================================================================
596 extern __at(0x0015) __sfr CCPR1
;
597 extern __at(0x0015) __sfr CCPR1L
;
598 extern __at(0x0016) __sfr CCPR1H
;
600 //==============================================================================
603 extern __at(0x0017) __sfr CCP1CON
;
651 extern __at(0x0017) volatile __CCP1CONbits_t CCP1CONbits
;
664 //==============================================================================
667 //==============================================================================
670 extern __at(0x0018) __sfr RCSTA
;
706 unsigned NOT_RC8
: 1;
723 extern __at(0x0018) volatile __RCSTAbits_t RCSTAbits
;
734 #define _NOT_RC8 0x40
738 //==============================================================================
740 extern __at(0x0019) __sfr TXREG
;
741 extern __at(0x001A) __sfr RCREG
;
742 extern __at(0x001B) __sfr CCPR2
;
743 extern __at(0x001B) __sfr CCPR2L
;
744 extern __at(0x001C) __sfr CCPR2H
;
746 //==============================================================================
749 extern __at(0x001D) __sfr CCP2CON
;
791 extern __at(0x001D) volatile __CCP2CONbits_t CCP2CONbits
;
802 //==============================================================================
804 extern __at(0x001E) __sfr ADRESH
;
806 //==============================================================================
809 extern __at(0x001F) __sfr ADCON0
;
816 unsigned GO_NOT_DONE
: 1;
840 unsigned NOT_DONE
: 1;
852 unsigned GO_DONE
: 1;
875 extern __at(0x001F) volatile __ADCON0bits_t ADCON0bits
;
878 #define _GO_NOT_DONE 0x02
880 #define _NOT_DONE 0x02
881 #define _GO_DONE 0x02
889 //==============================================================================
892 //==============================================================================
895 extern __at(0x0081) __sfr OPTION_REG
;
908 unsigned NOT_RBPU
: 1;
916 } __OPTION_REGbits_t
;
918 extern __at(0x0081) volatile __OPTION_REGbits_t OPTION_REGbits
;
927 #define _NOT_RBPU 0x80
929 //==============================================================================
932 //==============================================================================
935 extern __at(0x0085) __sfr TRISA
;
949 extern __at(0x0085) volatile __TRISAbits_t TRISAbits
;
960 //==============================================================================
963 //==============================================================================
966 extern __at(0x0086) __sfr TRISB
;
980 extern __at(0x0086) volatile __TRISBbits_t TRISBbits
;
991 //==============================================================================
994 //==============================================================================
997 extern __at(0x0087) __sfr TRISC
;
1001 unsigned TRISC0
: 1;
1002 unsigned TRISC1
: 1;
1003 unsigned TRISC2
: 1;
1004 unsigned TRISC3
: 1;
1005 unsigned TRISC4
: 1;
1006 unsigned TRISC5
: 1;
1007 unsigned TRISC6
: 1;
1008 unsigned TRISC7
: 1;
1011 extern __at(0x0087) volatile __TRISCbits_t TRISCbits
;
1013 #define _TRISC0 0x01
1014 #define _TRISC1 0x02
1015 #define _TRISC2 0x04
1016 #define _TRISC3 0x08
1017 #define _TRISC4 0x10
1018 #define _TRISC5 0x20
1019 #define _TRISC6 0x40
1020 #define _TRISC7 0x80
1022 //==============================================================================
1025 //==============================================================================
1028 extern __at(0x0088) __sfr TRISD
;
1032 unsigned TRISD0
: 1;
1033 unsigned TRISD1
: 1;
1034 unsigned TRISD2
: 1;
1035 unsigned TRISD3
: 1;
1036 unsigned TRISD4
: 1;
1037 unsigned TRISD5
: 1;
1038 unsigned TRISD6
: 1;
1039 unsigned TRISD7
: 1;
1042 extern __at(0x0088) volatile __TRISDbits_t TRISDbits
;
1044 #define _TRISD0 0x01
1045 #define _TRISD1 0x02
1046 #define _TRISD2 0x04
1047 #define _TRISD3 0x08
1048 #define _TRISD4 0x10
1049 #define _TRISD5 0x20
1050 #define _TRISD6 0x40
1051 #define _TRISD7 0x80
1053 //==============================================================================
1056 //==============================================================================
1059 extern __at(0x0089) __sfr TRISE
;
1065 unsigned TRISE0
: 1;
1066 unsigned TRISE1
: 1;
1067 unsigned TRISE2
: 1;
1068 unsigned TRISE3
: 1;
1082 extern __at(0x0089) volatile __TRISEbits_t TRISEbits
;
1084 #define _TRISE0 0x01
1085 #define _TRISE1 0x02
1086 #define _TRISE2 0x04
1087 #define _TRISE3 0x08
1089 //==============================================================================
1092 //==============================================================================
1095 extern __at(0x008C) __sfr PIE1
;
1099 unsigned TMR1IE
: 1;
1100 unsigned TMR2IE
: 1;
1101 unsigned CCP1IE
: 1;
1109 extern __at(0x008C) volatile __PIE1bits_t PIE1bits
;
1111 #define _TMR1IE 0x01
1112 #define _TMR2IE 0x02
1113 #define _CCP1IE 0x04
1119 //==============================================================================
1122 //==============================================================================
1125 extern __at(0x008D) __sfr PIE2
;
1129 unsigned CCP2IE
: 1;
1131 unsigned ULPWUIE
: 1;
1139 extern __at(0x008D) volatile __PIE2bits_t PIE2bits
;
1141 #define _CCP2IE 0x01
1142 #define _ULPWUIE 0x04
1149 //==============================================================================
1152 //==============================================================================
1155 extern __at(0x008E) __sfr PCON
;
1161 unsigned NOT_BOR
: 1;
1162 unsigned NOT_POR
: 1;
1165 unsigned SBOREN
: 1;
1166 unsigned ULPWUE
: 1;
1173 unsigned NOT_BO
: 1;
1184 extern __at(0x008E) volatile __PCONbits_t PCONbits
;
1186 #define _NOT_BOR 0x01
1187 #define _NOT_BO 0x01
1188 #define _NOT_POR 0x02
1189 #define _SBOREN 0x10
1190 #define _ULPWUE 0x20
1192 //==============================================================================
1195 //==============================================================================
1198 extern __at(0x008F) __sfr OSCCON
;
1222 extern __at(0x008F) volatile __OSCCONbits_t OSCCONbits
;
1232 //==============================================================================
1235 //==============================================================================
1238 extern __at(0x0090) __sfr OSCTUNE
;
1261 extern __at(0x0090) volatile __OSCTUNEbits_t OSCTUNEbits
;
1269 //==============================================================================
1272 //==============================================================================
1275 extern __at(0x0091) __sfr SSPCON2
;
1285 unsigned ACKSTAT
: 1;
1289 extern __at(0x0091) volatile __SSPCON2bits_t SSPCON2bits
;
1297 #define _ACKSTAT 0x40
1300 //==============================================================================
1302 extern __at(0x0092) __sfr PR2
;
1304 //==============================================================================
1307 extern __at(0x0093) __sfr MSK
;
1321 extern __at(0x0093) volatile __MSKbits_t MSKbits
;
1332 //==============================================================================
1334 extern __at(0x0093) __sfr SSPADD
;
1336 //==============================================================================
1339 extern __at(0x0093) __sfr SSPMSK
;
1353 extern __at(0x0093) volatile __SSPMSKbits_t SSPMSKbits
;
1355 #define _SSPMSK_MSK0 0x01
1356 #define _SSPMSK_MSK1 0x02
1357 #define _SSPMSK_MSK2 0x04
1358 #define _SSPMSK_MSK3 0x08
1359 #define _SSPMSK_MSK4 0x10
1360 #define _SSPMSK_MSK5 0x20
1361 #define _SSPMSK_MSK6 0x40
1362 #define _SSPMSK_MSK7 0x80
1364 //==============================================================================
1367 //==============================================================================
1370 extern __at(0x0094) __sfr SSPSTAT
;
1378 unsigned R_NOT_W
: 1;
1381 unsigned D_NOT_A
: 1;
1391 unsigned I2C_START
: 1;
1392 unsigned I2C_STOP
: 1;
1402 unsigned I2C_READ
: 1;
1405 unsigned I2C_DATA
: 1;
1426 unsigned NOT_WRITE
: 1;
1429 unsigned NOT_ADDRESS
: 1;
1450 unsigned READ_WRITE
: 1;
1453 unsigned DATA_ADDRESS
: 1;
1459 extern __at(0x0094) volatile __SSPSTATbits_t SSPSTATbits
;
1463 #define _R_NOT_W 0x04
1465 #define _I2C_READ 0x04
1467 #define _NOT_WRITE 0x04
1469 #define _READ_WRITE 0x04
1471 #define _I2C_START 0x08
1473 #define _I2C_STOP 0x10
1474 #define _D_NOT_A 0x20
1476 #define _I2C_DATA 0x20
1478 #define _NOT_ADDRESS 0x20
1480 #define _DATA_ADDRESS 0x20
1484 //==============================================================================
1487 //==============================================================================
1490 extern __at(0x0095) __sfr WPUB
;
1504 extern __at(0x0095) volatile __WPUBbits_t WPUBbits
;
1515 //==============================================================================
1518 //==============================================================================
1521 extern __at(0x0096) __sfr IOCB
;
1535 extern __at(0x0096) volatile __IOCBbits_t IOCBbits
;
1546 //==============================================================================
1549 //==============================================================================
1552 extern __at(0x0097) __sfr VRCON
;
1575 extern __at(0x0097) volatile __VRCONbits_t VRCONbits
;
1586 //==============================================================================
1589 //==============================================================================
1592 extern __at(0x0098) __sfr TXSTA
;
1616 unsigned NOT_TX8
: 1;
1633 extern __at(0x0098) volatile __TXSTAbits_t TXSTAbits
;
1643 #define _NOT_TX8 0x40
1647 //==============================================================================
1650 //==============================================================================
1653 extern __at(0x0099) __sfr SPBRG
;
1667 extern __at(0x0099) volatile __SPBRGbits_t SPBRGbits
;
1678 //==============================================================================
1681 //==============================================================================
1684 extern __at(0x009A) __sfr SPBRGH
;
1698 extern __at(0x009A) volatile __SPBRGHbits_t SPBRGHbits
;
1709 //==============================================================================
1712 //==============================================================================
1715 extern __at(0x009B) __sfr PWM1CON
;
1738 extern __at(0x009B) volatile __PWM1CONbits_t PWM1CONbits
;
1749 //==============================================================================
1752 //==============================================================================
1755 extern __at(0x009C) __sfr ECCPAS
;
1761 unsigned PSSBD0
: 1;
1762 unsigned PSSBD1
: 1;
1763 unsigned PSSAC0
: 1;
1764 unsigned PSSAC1
: 1;
1765 unsigned ECCPAS0
: 1;
1766 unsigned ECCPAS1
: 1;
1767 unsigned ECCPAS2
: 1;
1768 unsigned ECCPASE
: 1;
1787 unsigned ECCPAS
: 3;
1792 extern __at(0x009C) volatile __ECCPASbits_t ECCPASbits
;
1794 #define _PSSBD0 0x01
1795 #define _PSSBD1 0x02
1796 #define _PSSAC0 0x04
1797 #define _PSSAC1 0x08
1798 #define _ECCPAS0 0x10
1799 #define _ECCPAS1 0x20
1800 #define _ECCPAS2 0x40
1801 #define _ECCPASE 0x80
1803 //==============================================================================
1806 //==============================================================================
1809 extern __at(0x009D) __sfr PSTRCON
;
1817 unsigned STRSYNC
: 1;
1823 extern __at(0x009D) volatile __PSTRCONbits_t PSTRCONbits
;
1829 #define _STRSYNC 0x10
1831 //==============================================================================
1833 extern __at(0x009E) __sfr ADRESL
;
1835 //==============================================================================
1838 extern __at(0x009F) __sfr ADCON1
;
1862 extern __at(0x009F) volatile __ADCON1bits_t ADCON1bits
;
1868 //==============================================================================
1871 //==============================================================================
1874 extern __at(0x0105) __sfr WDTCON
;
1880 unsigned SWDTEN
: 1;
1881 unsigned WDTPS0
: 1;
1882 unsigned WDTPS1
: 1;
1883 unsigned WDTPS2
: 1;
1884 unsigned WDTPS3
: 1;
1898 extern __at(0x0105) volatile __WDTCONbits_t WDTCONbits
;
1900 #define _SWDTEN 0x01
1901 #define _WDTPS0 0x02
1902 #define _WDTPS1 0x04
1903 #define _WDTPS2 0x08
1904 #define _WDTPS3 0x10
1906 //==============================================================================
1909 //==============================================================================
1912 extern __at(0x0107) __sfr CM1CON0
;
1935 extern __at(0x0107) volatile __CM1CON0bits_t CM1CON0bits
;
1945 //==============================================================================
1948 //==============================================================================
1951 extern __at(0x0108) __sfr CM2CON0
;
1974 extern __at(0x0108) volatile __CM2CON0bits_t CM2CON0bits
;
1984 //==============================================================================
1987 //==============================================================================
1990 extern __at(0x0109) __sfr CM2CON1
;
1994 unsigned C2SYNC
: 1;
1998 unsigned C2RSEL
: 1;
1999 unsigned C1RSEL
: 1;
2000 unsigned MC2OUT
: 1;
2001 unsigned MC1OUT
: 1;
2004 extern __at(0x0109) volatile __CM2CON1bits_t CM2CON1bits
;
2006 #define _C2SYNC 0x01
2008 #define _C2RSEL 0x10
2009 #define _C1RSEL 0x20
2010 #define _MC2OUT 0x40
2011 #define _MC1OUT 0x80
2013 //==============================================================================
2015 extern __at(0x010C) __sfr EEDAT
;
2016 extern __at(0x010C) __sfr EEDATA
;
2017 extern __at(0x010D) __sfr EEADR
;
2018 extern __at(0x010E) __sfr EEDATH
;
2019 extern __at(0x010F) __sfr EEADRH
;
2021 //==============================================================================
2024 extern __at(0x0185) __sfr SRCON
;
2047 extern __at(0x0185) volatile __SRCONbits_t SRCONbits
;
2057 //==============================================================================
2060 //==============================================================================
2063 extern __at(0x0187) __sfr BAUDCTL
;
2065 #define BAUDCON BAUDCTL
2076 unsigned ABDOVF
: 1;
2079 extern __at(0x0187) volatile __BAUDCTLbits_t BAUDCTLbits
;
2081 #define BAUDCONbits BAUDCTLbits
2088 #define _ABDOVF 0x80
2090 //==============================================================================
2093 //==============================================================================
2096 extern __at(0x0188) __sfr ANSEL
;
2110 extern __at(0x0188) volatile __ANSELbits_t ANSELbits
;
2121 //==============================================================================
2124 //==============================================================================
2127 extern __at(0x0189) __sfr ANSELH
;
2141 extern __at(0x0189) volatile __ANSELHbits_t ANSELHbits
;
2150 //==============================================================================
2153 //==============================================================================
2156 extern __at(0x018C) __sfr EECON1
;
2170 extern __at(0x018C) volatile __EECON1bits_t EECON1bits
;
2178 //==============================================================================
2180 extern __at(0x018D) __sfr EECON2
;
2182 //==============================================================================
2184 // Configuration Bits
2186 //==============================================================================
2188 #define _CONFIG1 0x2007
2189 #define _CONFIG2 0x2008
2191 //----------------------------- CONFIG1 Options -------------------------------
2193 #define _FOSC_LP 0x3FF8 // LP oscillator: Low-power crystal on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2194 #define _LP_OSC 0x3FF8 // LP oscillator: Low-power crystal on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2195 #define _FOSC_XT 0x3FF9 // XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2196 #define _XT_OSC 0x3FF9 // XT oscillator: Crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2197 #define _FOSC_HS 0x3FFA // HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2198 #define _HS_OSC 0x3FFA // HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKOUT and RA7/OSC1/CLKIN.
2199 #define _FOSC_EC 0x3FFB // EC: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN.
2200 #define _EC_OSC 0x3FFB // EC: I/O function on RA6/OSC2/CLKOUT pin, CLKIN on RA7/OSC1/CLKIN.
2201 #define _FOSC_INTRC_NOCLKOUT 0x3FFC // INTOSCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN.
2202 #define _INTRC_OSC_NOCLKOUT 0x3FFC // INTOSCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN.
2203 #define _INTOSCIO 0x3FFC // INTOSCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN.
2204 #define _FOSC_INTRC_CLKOUT 0x3FFD // INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN.
2205 #define _INTRC_OSC_CLKOUT 0x3FFD // INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN.
2206 #define _INTOSC 0x3FFD // INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN.
2207 #define _FOSC_EXTRC_NOCLKOUT 0x3FFE // RCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2208 #define _EXTRC_OSC_NOCLKOUT 0x3FFE // RCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2209 #define _EXTRCIO 0x3FFE // RCIO oscillator: I/O function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2210 #define _FOSC_EXTRC_CLKOUT 0x3FFF // RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2211 #define _EXTRC_OSC_CLKOUT 0x3FFF // RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2212 #define _EXTRC 0x3FFF // RC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, RC on RA7/OSC1/CLKIN.
2213 #define _WDTE_OFF 0x3FF7 // WDT disabled and can be enabled by SWDTEN bit of the WDTCON register.
2214 #define _WDT_OFF 0x3FF7 // WDT disabled and can be enabled by SWDTEN bit of the WDTCON register.
2215 #define _WDTE_ON 0x3FFF // WDT enabled.
2216 #define _WDT_ON 0x3FFF // WDT enabled.
2217 #define _PWRTE_ON 0x3FEF // PWRT enabled.
2218 #define _PWRTE_OFF 0x3FFF // PWRT disabled.
2219 #define _MCLRE_OFF 0x3FDF // RE3/MCLR pin function is digital input, MCLR internally tied to VDD.
2220 #define _MCLRE_ON 0x3FFF // RE3/MCLR pin function is MCLR.
2221 #define _CP_ON 0x3FBF // Program memory code protection is enabled.
2222 #define _CP_OFF 0x3FFF // Program memory code protection is disabled.
2223 #define _CPD_ON 0x3F7F // Data memory code protection is enabled.
2224 #define _CPD_OFF 0x3FFF // Data memory code protection is disabled.
2225 #define _BOREN_OFF 0x3CFF // BOR disabled.
2226 #define _BOR_OFF 0x3CFF // BOR disabled.
2227 #define _BOREN_SBODEN 0x3DFF // BOR controlled by SBOREN bit of the PCON register.
2228 #define _BOR_SBODEN 0x3DFF // BOR controlled by SBOREN bit of the PCON register.
2229 #define _BOREN_NSLEEP 0x3EFF // BOR enabled during operation and disabled in Sleep.
2230 #define _BOR_NSLEEP 0x3EFF // BOR enabled during operation and disabled in Sleep.
2231 #define _BOREN_ON 0x3FFF // BOR enabled.
2232 #define _BOR_ON 0x3FFF // BOR enabled.
2233 #define _IESO_OFF 0x3BFF // Internal/External Switchover mode is disabled.
2234 #define _IESO_ON 0x3FFF // Internal/External Switchover mode is enabled.
2235 #define _FCMEN_OFF 0x37FF // Fail-Safe Clock Monitor is disabled.
2236 #define _FCMEN_ON 0x3FFF // Fail-Safe Clock Monitor is enabled.
2237 #define _LVP_OFF 0x2FFF // RB3 pin has digital I/O, HV on MCLR must be used for programming.
2238 #define _LVP_ON 0x3FFF // RB3/PGM pin has PGM function, low voltage programming enabled.
2239 #define _DEBUG_ON 0x1FFF // In_Circuit Debugger enabled, RB6/ICSPCLK and RB7/ICSPDAT are dedicated to the debugger.
2240 #define _DEBUG_OFF 0x3FFF // In-Circuit Debugger disabled, RB6/ICSPCLK and RB7/ICSPDAT are general purpose I/O pins.
2242 //----------------------------- CONFIG2 Options -------------------------------
2244 #define _BOR4V_BOR21V 0x3EFF // Brown-out Reset set to 2.1V.
2245 #define _BOR21V 0x3EFF // Brown-out Reset set to 2.1V.
2246 #define _BOR4V_BOR40V 0x3FFF // Brown-out Reset set to 4.0V.
2247 #define _BOR40V 0x3FFF // Brown-out Reset set to 4.0V.
2248 #define _WRT_HALF 0x39FF // 0000h to 0FFFh write protected, 1000h to 1FFFh may be modified by EECON control.
2249 #define _WRT_1FOURTH 0x3BFF // 0000h to 07FFh write protected, 0800h to 1FFFh may be modified by EECON control.
2250 #define _WRT_256 0x3DFF // 0000h to 00FFh write protected, 0100h to 1FFFh may be modified by EECON control.
2251 #define _WRT_OFF 0x3FFF // Write protection off.
2253 //==============================================================================
2255 #define _DEVID1 0x2006
2257 #define _IDLOC0 0x2000
2258 #define _IDLOC1 0x2001
2259 #define _IDLOC2 0x2002
2260 #define _IDLOC3 0x2003
2262 //==============================================================================
2264 #ifndef NO_BIT_DEFINES
2266 #define ADON ADCON0bits.ADON // bit 0
2267 #define GO_NOT_DONE ADCON0bits.GO_NOT_DONE // bit 1, shadows bit in ADCON0bits
2268 #define GO ADCON0bits.GO // bit 1, shadows bit in ADCON0bits
2269 #define NOT_DONE ADCON0bits.NOT_DONE // bit 1, shadows bit in ADCON0bits
2270 #define GO_DONE ADCON0bits.GO_DONE // bit 1, shadows bit in ADCON0bits
2271 #define CHS0 ADCON0bits.CHS0 // bit 2
2272 #define CHS1 ADCON0bits.CHS1 // bit 3
2273 #define CHS2 ADCON0bits.CHS2 // bit 4
2274 #define CHS3 ADCON0bits.CHS3 // bit 5
2275 #define ADCS0 ADCON0bits.ADCS0 // bit 6
2276 #define ADCS1 ADCON0bits.ADCS1 // bit 7
2278 #define VCFG0 ADCON1bits.VCFG0 // bit 4
2279 #define VCFG1 ADCON1bits.VCFG1 // bit 5
2280 #define ADFM ADCON1bits.ADFM // bit 7
2282 #define ANS0 ANSELbits.ANS0 // bit 0
2283 #define ANS1 ANSELbits.ANS1 // bit 1
2284 #define ANS2 ANSELbits.ANS2 // bit 2
2285 #define ANS3 ANSELbits.ANS3 // bit 3
2286 #define ANS4 ANSELbits.ANS4 // bit 4
2287 #define ANS5 ANSELbits.ANS5 // bit 5
2288 #define ANS6 ANSELbits.ANS6 // bit 6
2289 #define ANS7 ANSELbits.ANS7 // bit 7
2291 #define ANS8 ANSELHbits.ANS8 // bit 0
2292 #define ANS9 ANSELHbits.ANS9 // bit 1
2293 #define ANS10 ANSELHbits.ANS10 // bit 2
2294 #define ANS11 ANSELHbits.ANS11 // bit 3
2295 #define ANS12 ANSELHbits.ANS12 // bit 4
2296 #define ANS13 ANSELHbits.ANS13 // bit 5
2298 #define ABDEN BAUDCTLbits.ABDEN // bit 0
2299 #define WUE BAUDCTLbits.WUE // bit 1
2300 #define BRG16 BAUDCTLbits.BRG16 // bit 3
2301 #define SCKP BAUDCTLbits.SCKP // bit 4
2302 #define RCIDL BAUDCTLbits.RCIDL // bit 6
2303 #define ABDOVF BAUDCTLbits.ABDOVF // bit 7
2305 #define CCP1M0 CCP1CONbits.CCP1M0 // bit 0
2306 #define CCP1M1 CCP1CONbits.CCP1M1 // bit 1
2307 #define CCP1M2 CCP1CONbits.CCP1M2 // bit 2
2308 #define CCP1M3 CCP1CONbits.CCP1M3 // bit 3
2309 #define DC1B0 CCP1CONbits.DC1B0 // bit 4, shadows bit in CCP1CONbits
2310 #define CCP1Y CCP1CONbits.CCP1Y // bit 4, shadows bit in CCP1CONbits
2311 #define DC1B1 CCP1CONbits.DC1B1 // bit 5, shadows bit in CCP1CONbits
2312 #define CCP1X CCP1CONbits.CCP1X // bit 5, shadows bit in CCP1CONbits
2313 #define P1M0 CCP1CONbits.P1M0 // bit 6
2314 #define P1M1 CCP1CONbits.P1M1 // bit 7
2316 #define CCP2M0 CCP2CONbits.CCP2M0 // bit 0
2317 #define CCP2M1 CCP2CONbits.CCP2M1 // bit 1
2318 #define CCP2M2 CCP2CONbits.CCP2M2 // bit 2
2319 #define CCP2M3 CCP2CONbits.CCP2M3 // bit 3
2320 #define DC2B0 CCP2CONbits.DC2B0 // bit 4, shadows bit in CCP2CONbits
2321 #define CCP2Y CCP2CONbits.CCP2Y // bit 4, shadows bit in CCP2CONbits
2322 #define DC2B1 CCP2CONbits.DC2B1 // bit 5, shadows bit in CCP2CONbits
2323 #define CCP2X CCP2CONbits.CCP2X // bit 5, shadows bit in CCP2CONbits
2325 #define C1CH0 CM1CON0bits.C1CH0 // bit 0
2326 #define C1CH1 CM1CON0bits.C1CH1 // bit 1
2327 #define C1R CM1CON0bits.C1R // bit 2
2328 #define C1POL CM1CON0bits.C1POL // bit 4
2329 #define C1OE CM1CON0bits.C1OE // bit 5
2330 #define C1OUT CM1CON0bits.C1OUT // bit 6
2331 #define C1ON CM1CON0bits.C1ON // bit 7
2333 #define C2CH0 CM2CON0bits.C2CH0 // bit 0
2334 #define C2CH1 CM2CON0bits.C2CH1 // bit 1
2335 #define C2R CM2CON0bits.C2R // bit 2
2336 #define C2POL CM2CON0bits.C2POL // bit 4
2337 #define C2OE CM2CON0bits.C2OE // bit 5
2338 #define C2OUT CM2CON0bits.C2OUT // bit 6
2339 #define C2ON CM2CON0bits.C2ON // bit 7
2341 #define C2SYNC CM2CON1bits.C2SYNC // bit 0
2342 #define T1GSS CM2CON1bits.T1GSS // bit 1
2343 #define C2RSEL CM2CON1bits.C2RSEL // bit 4
2344 #define C1RSEL CM2CON1bits.C1RSEL // bit 5
2345 #define MC2OUT CM2CON1bits.MC2OUT // bit 6
2346 #define MC1OUT CM2CON1bits.MC1OUT // bit 7
2348 #define PSSBD0 ECCPASbits.PSSBD0 // bit 0
2349 #define PSSBD1 ECCPASbits.PSSBD1 // bit 1
2350 #define PSSAC0 ECCPASbits.PSSAC0 // bit 2
2351 #define PSSAC1 ECCPASbits.PSSAC1 // bit 3
2352 #define ECCPAS0 ECCPASbits.ECCPAS0 // bit 4
2353 #define ECCPAS1 ECCPASbits.ECCPAS1 // bit 5
2354 #define ECCPAS2 ECCPASbits.ECCPAS2 // bit 6
2355 #define ECCPASE ECCPASbits.ECCPASE // bit 7
2357 #define RD EECON1bits.RD // bit 0
2358 #define WR EECON1bits.WR // bit 1
2359 #define WREN EECON1bits.WREN // bit 2
2360 #define WRERR EECON1bits.WRERR // bit 3
2361 #define EEPGD EECON1bits.EEPGD // bit 7
2363 #define RBIF INTCONbits.RBIF // bit 0
2364 #define INTF INTCONbits.INTF // bit 1
2365 #define T0IF INTCONbits.T0IF // bit 2, shadows bit in INTCONbits
2366 #define TMR0IF INTCONbits.TMR0IF // bit 2, shadows bit in INTCONbits
2367 #define RBIE INTCONbits.RBIE // bit 3
2368 #define INTE INTCONbits.INTE // bit 4
2369 #define T0IE INTCONbits.T0IE // bit 5, shadows bit in INTCONbits
2370 #define TMR0IE INTCONbits.TMR0IE // bit 5, shadows bit in INTCONbits
2371 #define PEIE INTCONbits.PEIE // bit 6
2372 #define GIE INTCONbits.GIE // bit 7
2374 #define IOCB0 IOCBbits.IOCB0 // bit 0
2375 #define IOCB1 IOCBbits.IOCB1 // bit 1
2376 #define IOCB2 IOCBbits.IOCB2 // bit 2
2377 #define IOCB3 IOCBbits.IOCB3 // bit 3
2378 #define IOCB4 IOCBbits.IOCB4 // bit 4
2379 #define IOCB5 IOCBbits.IOCB5 // bit 5
2380 #define IOCB6 IOCBbits.IOCB6 // bit 6
2381 #define IOCB7 IOCBbits.IOCB7 // bit 7
2383 #define MSK0 MSKbits.MSK0 // bit 0
2384 #define MSK1 MSKbits.MSK1 // bit 1
2385 #define MSK2 MSKbits.MSK2 // bit 2
2386 #define MSK3 MSKbits.MSK3 // bit 3
2387 #define MSK4 MSKbits.MSK4 // bit 4
2388 #define MSK5 MSKbits.MSK5 // bit 5
2389 #define MSK6 MSKbits.MSK6 // bit 6
2390 #define MSK7 MSKbits.MSK7 // bit 7
2392 #define PS0 OPTION_REGbits.PS0 // bit 0
2393 #define PS1 OPTION_REGbits.PS1 // bit 1
2394 #define PS2 OPTION_REGbits.PS2 // bit 2
2395 #define PSA OPTION_REGbits.PSA // bit 3
2396 #define T0SE OPTION_REGbits.T0SE // bit 4
2397 #define T0CS OPTION_REGbits.T0CS // bit 5
2398 #define INTEDG OPTION_REGbits.INTEDG // bit 6
2399 #define NOT_RBPU OPTION_REGbits.NOT_RBPU // bit 7
2401 #define SCS OSCCONbits.SCS // bit 0
2402 #define LTS OSCCONbits.LTS // bit 1
2403 #define HTS OSCCONbits.HTS // bit 2
2404 #define OSTS OSCCONbits.OSTS // bit 3
2405 #define IRCF0 OSCCONbits.IRCF0 // bit 4
2406 #define IRCF1 OSCCONbits.IRCF1 // bit 5
2407 #define IRCF2 OSCCONbits.IRCF2 // bit 6
2409 #define TUN0 OSCTUNEbits.TUN0 // bit 0
2410 #define TUN1 OSCTUNEbits.TUN1 // bit 1
2411 #define TUN2 OSCTUNEbits.TUN2 // bit 2
2412 #define TUN3 OSCTUNEbits.TUN3 // bit 3
2413 #define TUN4 OSCTUNEbits.TUN4 // bit 4
2415 #define NOT_BOR PCONbits.NOT_BOR // bit 0, shadows bit in PCONbits
2416 #define NOT_BO PCONbits.NOT_BO // bit 0, shadows bit in PCONbits
2417 #define NOT_POR PCONbits.NOT_POR // bit 1
2418 #define SBOREN PCONbits.SBOREN // bit 4
2419 #define ULPWUE PCONbits.ULPWUE // bit 5
2421 #define TMR1IE PIE1bits.TMR1IE // bit 0
2422 #define TMR2IE PIE1bits.TMR2IE // bit 1
2423 #define CCP1IE PIE1bits.CCP1IE // bit 2
2424 #define SSPIE PIE1bits.SSPIE // bit 3
2425 #define TXIE PIE1bits.TXIE // bit 4
2426 #define RCIE PIE1bits.RCIE // bit 5
2427 #define ADIE PIE1bits.ADIE // bit 6
2429 #define CCP2IE PIE2bits.CCP2IE // bit 0
2430 #define ULPWUIE PIE2bits.ULPWUIE // bit 2
2431 #define BCLIE PIE2bits.BCLIE // bit 3
2432 #define EEIE PIE2bits.EEIE // bit 4
2433 #define C1IE PIE2bits.C1IE // bit 5
2434 #define C2IE PIE2bits.C2IE // bit 6
2435 #define OSFIE PIE2bits.OSFIE // bit 7
2437 #define TMR1IF PIR1bits.TMR1IF // bit 0
2438 #define TMR2IF PIR1bits.TMR2IF // bit 1
2439 #define CCP1IF PIR1bits.CCP1IF // bit 2
2440 #define SSPIF PIR1bits.SSPIF // bit 3
2441 #define TXIF PIR1bits.TXIF // bit 4
2442 #define RCIF PIR1bits.RCIF // bit 5
2443 #define ADIF PIR1bits.ADIF // bit 6
2445 #define CCP2IF PIR2bits.CCP2IF // bit 0
2446 #define ULPWUIF PIR2bits.ULPWUIF // bit 2
2447 #define BCLIF PIR2bits.BCLIF // bit 3
2448 #define EEIF PIR2bits.EEIF // bit 4
2449 #define C1IF PIR2bits.C1IF // bit 5
2450 #define C2IF PIR2bits.C2IF // bit 6
2451 #define OSFIF PIR2bits.OSFIF // bit 7
2453 #define RA0 PORTAbits.RA0 // bit 0
2454 #define RA1 PORTAbits.RA1 // bit 1
2455 #define RA2 PORTAbits.RA2 // bit 2
2456 #define RA3 PORTAbits.RA3 // bit 3
2457 #define RA4 PORTAbits.RA4 // bit 4
2458 #define RA5 PORTAbits.RA5 // bit 5
2459 #define RA6 PORTAbits.RA6 // bit 6
2460 #define RA7 PORTAbits.RA7 // bit 7
2462 #define RB0 PORTBbits.RB0 // bit 0
2463 #define RB1 PORTBbits.RB1 // bit 1
2464 #define RB2 PORTBbits.RB2 // bit 2
2465 #define RB3 PORTBbits.RB3 // bit 3
2466 #define RB4 PORTBbits.RB4 // bit 4
2467 #define RB5 PORTBbits.RB5 // bit 5
2468 #define RB6 PORTBbits.RB6 // bit 6
2469 #define RB7 PORTBbits.RB7 // bit 7
2471 #define RC0 PORTCbits.RC0 // bit 0
2472 #define RC1 PORTCbits.RC1 // bit 1
2473 #define RC2 PORTCbits.RC2 // bit 2
2474 #define RC3 PORTCbits.RC3 // bit 3
2475 #define RC4 PORTCbits.RC4 // bit 4
2476 #define RC5 PORTCbits.RC5 // bit 5
2477 #define RC6 PORTCbits.RC6 // bit 6
2478 #define RC7 PORTCbits.RC7 // bit 7
2480 #define RD0 PORTDbits.RD0 // bit 0
2481 #define RD1 PORTDbits.RD1 // bit 1
2482 #define RD2 PORTDbits.RD2 // bit 2
2483 #define RD3 PORTDbits.RD3 // bit 3
2484 #define RD4 PORTDbits.RD4 // bit 4
2485 #define RD5 PORTDbits.RD5 // bit 5
2486 #define RD6 PORTDbits.RD6 // bit 6
2487 #define RD7 PORTDbits.RD7 // bit 7
2489 #define RE0 PORTEbits.RE0 // bit 0
2490 #define RE1 PORTEbits.RE1 // bit 1
2491 #define RE2 PORTEbits.RE2 // bit 2
2492 #define RE3 PORTEbits.RE3 // bit 3
2494 #define STRA PSTRCONbits.STRA // bit 0
2495 #define STRB PSTRCONbits.STRB // bit 1
2496 #define STRC PSTRCONbits.STRC // bit 2
2497 #define STRD PSTRCONbits.STRD // bit 3
2498 #define STRSYNC PSTRCONbits.STRSYNC // bit 4
2500 #define PDC0 PWM1CONbits.PDC0 // bit 0
2501 #define PDC1 PWM1CONbits.PDC1 // bit 1
2502 #define PDC2 PWM1CONbits.PDC2 // bit 2
2503 #define PDC3 PWM1CONbits.PDC3 // bit 3
2504 #define PDC4 PWM1CONbits.PDC4 // bit 4
2505 #define PDC5 PWM1CONbits.PDC5 // bit 5
2506 #define PDC6 PWM1CONbits.PDC6 // bit 6
2507 #define PRSEN PWM1CONbits.PRSEN // bit 7
2509 #define RX9D RCSTAbits.RX9D // bit 0, shadows bit in RCSTAbits
2510 #define RCD8 RCSTAbits.RCD8 // bit 0, shadows bit in RCSTAbits
2511 #define OERR RCSTAbits.OERR // bit 1
2512 #define FERR RCSTAbits.FERR // bit 2
2513 #define ADDEN RCSTAbits.ADDEN // bit 3
2514 #define CREN RCSTAbits.CREN // bit 4
2515 #define SREN RCSTAbits.SREN // bit 5
2516 #define RX9 RCSTAbits.RX9 // bit 6, shadows bit in RCSTAbits
2517 #define RC9 RCSTAbits.RC9 // bit 6, shadows bit in RCSTAbits
2518 #define NOT_RC8 RCSTAbits.NOT_RC8 // bit 6, shadows bit in RCSTAbits
2519 #define RC8_9 RCSTAbits.RC8_9 // bit 6, shadows bit in RCSTAbits
2520 #define SPEN RCSTAbits.SPEN // bit 7
2522 #define BRG0 SPBRGbits.BRG0 // bit 0
2523 #define BRG1 SPBRGbits.BRG1 // bit 1
2524 #define BRG2 SPBRGbits.BRG2 // bit 2
2525 #define BRG3 SPBRGbits.BRG3 // bit 3
2526 #define BRG4 SPBRGbits.BRG4 // bit 4
2527 #define BRG5 SPBRGbits.BRG5 // bit 5
2528 #define BRG6 SPBRGbits.BRG6 // bit 6
2529 #define BRG7 SPBRGbits.BRG7 // bit 7
2531 #define BRG8 SPBRGHbits.BRG8 // bit 0
2532 #define BRG9 SPBRGHbits.BRG9 // bit 1
2533 #define BRG10 SPBRGHbits.BRG10 // bit 2
2534 #define BRG11 SPBRGHbits.BRG11 // bit 3
2535 #define BRG12 SPBRGHbits.BRG12 // bit 4
2536 #define BRG13 SPBRGHbits.BRG13 // bit 5
2537 #define BRG14 SPBRGHbits.BRG14 // bit 6
2538 #define BRG15 SPBRGHbits.BRG15 // bit 7
2540 #define FVREN SRCONbits.FVREN // bit 0
2541 #define PULSR SRCONbits.PULSR // bit 2
2542 #define PULSS SRCONbits.PULSS // bit 3
2543 #define C2REN SRCONbits.C2REN // bit 4
2544 #define C1SEN SRCONbits.C1SEN // bit 5
2545 #define SR0 SRCONbits.SR0 // bit 6
2546 #define SR1 SRCONbits.SR1 // bit 7
2548 #define SSPM0 SSPCONbits.SSPM0 // bit 0
2549 #define SSPM1 SSPCONbits.SSPM1 // bit 1
2550 #define SSPM2 SSPCONbits.SSPM2 // bit 2
2551 #define SSPM3 SSPCONbits.SSPM3 // bit 3
2552 #define CKP SSPCONbits.CKP // bit 4
2553 #define SSPEN SSPCONbits.SSPEN // bit 5
2554 #define SSPOV SSPCONbits.SSPOV // bit 6
2555 #define WCOL SSPCONbits.WCOL // bit 7
2557 #define SEN SSPCON2bits.SEN // bit 0
2558 #define RSEN SSPCON2bits.RSEN // bit 1
2559 #define PEN SSPCON2bits.PEN // bit 2
2560 #define RCEN SSPCON2bits.RCEN // bit 3
2561 #define ACKEN SSPCON2bits.ACKEN // bit 4
2562 #define ACKDT SSPCON2bits.ACKDT // bit 5
2563 #define ACKSTAT SSPCON2bits.ACKSTAT // bit 6
2564 #define GCEN SSPCON2bits.GCEN // bit 7
2566 #define BF SSPSTATbits.BF // bit 0
2567 #define UA SSPSTATbits.UA // bit 1
2568 #define R_NOT_W SSPSTATbits.R_NOT_W // bit 2, shadows bit in SSPSTATbits
2569 #define R SSPSTATbits.R // bit 2, shadows bit in SSPSTATbits
2570 #define I2C_READ SSPSTATbits.I2C_READ // bit 2, shadows bit in SSPSTATbits
2571 #define NOT_W SSPSTATbits.NOT_W // bit 2, shadows bit in SSPSTATbits
2572 #define NOT_WRITE SSPSTATbits.NOT_WRITE // bit 2, shadows bit in SSPSTATbits
2573 #define R_W SSPSTATbits.R_W // bit 2, shadows bit in SSPSTATbits
2574 #define READ_WRITE SSPSTATbits.READ_WRITE // bit 2, shadows bit in SSPSTATbits
2575 #define S SSPSTATbits.S // bit 3, shadows bit in SSPSTATbits
2576 #define I2C_START SSPSTATbits.I2C_START // bit 3, shadows bit in SSPSTATbits
2577 #define P SSPSTATbits.P // bit 4, shadows bit in SSPSTATbits
2578 #define I2C_STOP SSPSTATbits.I2C_STOP // bit 4, shadows bit in SSPSTATbits
2579 #define D_NOT_A SSPSTATbits.D_NOT_A // bit 5, shadows bit in SSPSTATbits
2580 #define D SSPSTATbits.D // bit 5, shadows bit in SSPSTATbits
2581 #define I2C_DATA SSPSTATbits.I2C_DATA // bit 5, shadows bit in SSPSTATbits
2582 #define NOT_A SSPSTATbits.NOT_A // bit 5, shadows bit in SSPSTATbits
2583 #define NOT_ADDRESS SSPSTATbits.NOT_ADDRESS // bit 5, shadows bit in SSPSTATbits
2584 #define D_A SSPSTATbits.D_A // bit 5, shadows bit in SSPSTATbits
2585 #define DATA_ADDRESS SSPSTATbits.DATA_ADDRESS // bit 5, shadows bit in SSPSTATbits
2586 #define CKE SSPSTATbits.CKE // bit 6
2587 #define SMP SSPSTATbits.SMP // bit 7
2589 #define C STATUSbits.C // bit 0
2590 #define DC STATUSbits.DC // bit 1
2591 #define Z STATUSbits.Z // bit 2
2592 #define NOT_PD STATUSbits.NOT_PD // bit 3
2593 #define NOT_TO STATUSbits.NOT_TO // bit 4
2594 #define RP0 STATUSbits.RP0 // bit 5
2595 #define RP1 STATUSbits.RP1 // bit 6
2596 #define IRP STATUSbits.IRP // bit 7
2598 #define TMR1ON T1CONbits.TMR1ON // bit 0
2599 #define TMR1CS T1CONbits.TMR1CS // bit 1
2600 #define NOT_T1SYNC T1CONbits.NOT_T1SYNC // bit 2, shadows bit in T1CONbits
2601 #define T1INSYNC T1CONbits.T1INSYNC // bit 2, shadows bit in T1CONbits
2602 #define T1SYNC T1CONbits.T1SYNC // bit 2, shadows bit in T1CONbits
2603 #define T1OSCEN T1CONbits.T1OSCEN // bit 3
2604 #define T1CKPS0 T1CONbits.T1CKPS0 // bit 4
2605 #define T1CKPS1 T1CONbits.T1CKPS1 // bit 5
2606 #define TMR1GE T1CONbits.TMR1GE // bit 6
2607 #define T1GINV T1CONbits.T1GINV // bit 7, shadows bit in T1CONbits
2608 #define T1GIV T1CONbits.T1GIV // bit 7, shadows bit in T1CONbits
2610 #define T2CKPS0 T2CONbits.T2CKPS0 // bit 0
2611 #define T2CKPS1 T2CONbits.T2CKPS1 // bit 1
2612 #define TMR2ON T2CONbits.TMR2ON // bit 2
2613 #define TOUTPS0 T2CONbits.TOUTPS0 // bit 3
2614 #define TOUTPS1 T2CONbits.TOUTPS1 // bit 4
2615 #define TOUTPS2 T2CONbits.TOUTPS2 // bit 5
2616 #define TOUTPS3 T2CONbits.TOUTPS3 // bit 6
2618 #define TRISA0 TRISAbits.TRISA0 // bit 0
2619 #define TRISA1 TRISAbits.TRISA1 // bit 1
2620 #define TRISA2 TRISAbits.TRISA2 // bit 2
2621 #define TRISA3 TRISAbits.TRISA3 // bit 3
2622 #define TRISA4 TRISAbits.TRISA4 // bit 4
2623 #define TRISA5 TRISAbits.TRISA5 // bit 5
2624 #define TRISA6 TRISAbits.TRISA6 // bit 6
2625 #define TRISA7 TRISAbits.TRISA7 // bit 7
2627 #define TRISB0 TRISBbits.TRISB0 // bit 0
2628 #define TRISB1 TRISBbits.TRISB1 // bit 1
2629 #define TRISB2 TRISBbits.TRISB2 // bit 2
2630 #define TRISB3 TRISBbits.TRISB3 // bit 3
2631 #define TRISB4 TRISBbits.TRISB4 // bit 4
2632 #define TRISB5 TRISBbits.TRISB5 // bit 5
2633 #define TRISB6 TRISBbits.TRISB6 // bit 6
2634 #define TRISB7 TRISBbits.TRISB7 // bit 7
2636 #define TRISC0 TRISCbits.TRISC0 // bit 0
2637 #define TRISC1 TRISCbits.TRISC1 // bit 1
2638 #define TRISC2 TRISCbits.TRISC2 // bit 2
2639 #define TRISC3 TRISCbits.TRISC3 // bit 3
2640 #define TRISC4 TRISCbits.TRISC4 // bit 4
2641 #define TRISC5 TRISCbits.TRISC5 // bit 5
2642 #define TRISC6 TRISCbits.TRISC6 // bit 6
2643 #define TRISC7 TRISCbits.TRISC7 // bit 7
2645 #define TRISD0 TRISDbits.TRISD0 // bit 0
2646 #define TRISD1 TRISDbits.TRISD1 // bit 1
2647 #define TRISD2 TRISDbits.TRISD2 // bit 2
2648 #define TRISD3 TRISDbits.TRISD3 // bit 3
2649 #define TRISD4 TRISDbits.TRISD4 // bit 4
2650 #define TRISD5 TRISDbits.TRISD5 // bit 5
2651 #define TRISD6 TRISDbits.TRISD6 // bit 6
2652 #define TRISD7 TRISDbits.TRISD7 // bit 7
2654 #define TRISE0 TRISEbits.TRISE0 // bit 0
2655 #define TRISE1 TRISEbits.TRISE1 // bit 1
2656 #define TRISE2 TRISEbits.TRISE2 // bit 2
2657 #define TRISE3 TRISEbits.TRISE3 // bit 3
2659 #define TX9D TXSTAbits.TX9D // bit 0, shadows bit in TXSTAbits
2660 #define TXD8 TXSTAbits.TXD8 // bit 0, shadows bit in TXSTAbits
2661 #define TRMT TXSTAbits.TRMT // bit 1
2662 #define BRGH TXSTAbits.BRGH // bit 2
2663 #define SENDB TXSTAbits.SENDB // bit 3
2664 #define SYNC TXSTAbits.SYNC // bit 4
2665 #define TXEN TXSTAbits.TXEN // bit 5
2666 #define TX9 TXSTAbits.TX9 // bit 6, shadows bit in TXSTAbits
2667 #define NOT_TX8 TXSTAbits.NOT_TX8 // bit 6, shadows bit in TXSTAbits
2668 #define TX8_9 TXSTAbits.TX8_9 // bit 6, shadows bit in TXSTAbits
2669 #define CSRC TXSTAbits.CSRC // bit 7
2671 #define VR0 VRCONbits.VR0 // bit 0
2672 #define VR1 VRCONbits.VR1 // bit 1
2673 #define VR2 VRCONbits.VR2 // bit 2
2674 #define VR3 VRCONbits.VR3 // bit 3
2675 #define VRSS VRCONbits.VRSS // bit 4
2676 #define VRR VRCONbits.VRR // bit 5
2677 #define VROE VRCONbits.VROE // bit 6
2678 #define VREN VRCONbits.VREN // bit 7
2680 #define SWDTEN WDTCONbits.SWDTEN // bit 0
2681 #define WDTPS0 WDTCONbits.WDTPS0 // bit 1
2682 #define WDTPS1 WDTCONbits.WDTPS1 // bit 2
2683 #define WDTPS2 WDTCONbits.WDTPS2 // bit 3
2684 #define WDTPS3 WDTCONbits.WDTPS3 // bit 4
2686 #define WPUB0 WPUBbits.WPUB0 // bit 0
2687 #define WPUB1 WPUBbits.WPUB1 // bit 1
2688 #define WPUB2 WPUBbits.WPUB2 // bit 2
2689 #define WPUB3 WPUBbits.WPUB3 // bit 3
2690 #define WPUB4 WPUBbits.WPUB4 // bit 4
2691 #define WPUB5 WPUBbits.WPUB5 // bit 5
2692 #define WPUB6 WPUBbits.WPUB6 // bit 6
2693 #define WPUB7 WPUBbits.WPUB7 // bit 7
2695 #endif // #ifndef NO_BIT_DEFINES
2697 #endif // #ifndef __PIC16F887_H__