2 // Register Declarations for Microchip 16F84 Processor
5 // This header file was automatically generated by:
9 // Copyright (c) 2002, Kevin L. Pauba, All Rights Reserved
11 // SDCC is licensed under the GNU Public license (GPL) v2. Note that
12 // this license covers the code to the compiler and other executables,
13 // but explicitly does not cover any code or objects generated by sdcc.
14 // We have not yet decided on a license for the run time libraries, but
15 // it will not put any requirements on code linked against it. See:
17 // http://www.gnu.org/copyleft/gpl/html
19 // See http://sdcc.sourceforge.net/ for the latest information on sdcc.
26 // Register addresses.
28 #define INDF_ADDR 0x0000
29 #define TMR0_ADDR 0x0001
30 #define PCL_ADDR 0x0002
31 #define STATUS_ADDR 0x0003
32 #define FSR_ADDR 0x0004
33 #define PORTA_ADDR 0x0005
34 #define PORTB_ADDR 0x0006
35 #define EEDATA_ADDR 0x0008
36 #define EEADR_ADDR 0x0009
37 #define PCLATH_ADDR 0x000A
38 #define INTCON_ADDR 0x000B
39 #define OPTION_REG_ADDR 0x0081
40 #define TRISA_ADDR 0x0085
41 #define TRISB_ADDR 0x0086
42 #define EECON1_ADDR 0x0088
43 #define EECON2_ADDR 0x0089
46 // Memory organization.
52 // P16F84.INC Standard Header File, Version 2.00 Microchip Technology, Inc.
55 // This header file defines configurations, registers, and other useful bits of
56 // information for the PIC16F84 microcontroller. These names are taken to match
57 // the data sheets as closely as possible.
59 // Note that the processor must be selected before this file is
60 // included. The processor may be selected the following ways:
62 // 1. Command line switch:
63 // C:\ MPASM MYFILE.ASM /PIC16F84
64 // 2. LIST directive in the source file
66 // 3. Processor Type entry in the MPASM full-screen interface
68 //==========================================================================
72 //==========================================================================
76 //2.00 07/24/96 Renamed to reflect the name change to PIC16F84.
77 //1.01 05/17/96 Corrected BADRAM map
78 //1.00 10/31/95 Initial Release
80 //==========================================================================
84 //==========================================================================
87 // MESSG "Processor-header file mismatch. Verify selected processor."
90 //==========================================================================
92 // Register Definitions
94 //==========================================================================
99 //----- Register Files------------------------------------------------------
101 extern __sfr __at (INDF_ADDR) INDF;
102 extern __sfr __at (TMR0_ADDR) TMR0;
103 extern __sfr __at (PCL_ADDR) PCL;
104 extern __sfr __at (STATUS_ADDR) STATUS;
105 extern __sfr __at (FSR_ADDR) FSR;
106 extern __sfr __at (PORTA_ADDR) PORTA;
107 extern __sfr __at (PORTB_ADDR) PORTB;
108 extern __sfr __at (EEDATA_ADDR) EEDATA;
109 extern __sfr __at (EEADR_ADDR) EEADR;
110 extern __sfr __at (PCLATH_ADDR) PCLATH;
111 extern __sfr __at (INTCON_ADDR) INTCON;
113 extern __sfr __at (OPTION_REG_ADDR) OPTION_REG;
114 extern __sfr __at (TRISA_ADDR) TRISA;
115 extern __sfr __at (TRISB_ADDR) TRISB;
116 extern __sfr __at (EECON1_ADDR) EECON1;
117 extern __sfr __at (EECON2_ADDR) EECON2;
119 //----- STATUS Bits --------------------------------------------------------
122 //----- INTCON Bits --------------------------------------------------------
125 //----- OPTION Bits --------------------------------------------------------
128 //----- EECON1 Bits --------------------------------------------------------
131 //==========================================================================
135 //==========================================================================
138 // __BADRAM H'07', H'50'-H'7F', H'87'
140 //==========================================================================
142 // Configuration Bits
144 //==========================================================================
146 #define _CP_ON 0x000F
147 #define _CP_OFF 0x3FFF
148 #define _PWRTE_ON 0x3FF7
149 #define _PWRTE_OFF 0x3FFF
150 #define _WDT_ON 0x3FFF
151 #define _WDT_OFF 0x3FFB
152 #define _LP_OSC 0x3FFC
153 #define _XT_OSC 0x3FFD
154 #define _HS_OSC 0x3FFE
155 #define _RC_OSC 0x3FFF
159 // ----- EECON1 bits --------------------
164 unsigned char WREN:1;
165 unsigned char WRERR:1;
166 unsigned char EEIF:1;
172 extern volatile __EECON1_bits_t __at(EECON1_ADDR) EECON1_bits;
174 #ifndef NO_BIT_DEFINES
175 #define RD EECON1_bits.RD
176 #define WR EECON1_bits.WR
177 #define WREN EECON1_bits.WREN
178 #define WRERR EECON1_bits.WRERR
179 #define EEIF EECON1_bits.EEIF
180 #endif /* NO_BIT_DEFINES */
182 // ----- INTCON bits --------------------
185 unsigned char RBIF:1;
186 unsigned char INTF:1;
187 unsigned char T0IF:1;
188 unsigned char RBIE:1;
189 unsigned char INTE:1;
190 unsigned char T0IE:1;
191 unsigned char EEIE:1;
195 extern volatile __INTCON_bits_t __at(INTCON_ADDR) INTCON_bits;
197 #ifndef NO_BIT_DEFINES
198 #define RBIF INTCON_bits.RBIF
199 #define INTF INTCON_bits.INTF
200 #define T0IF INTCON_bits.T0IF
201 #define RBIE INTCON_bits.RBIE
202 #define INTE INTCON_bits.INTE
203 #define T0IE INTCON_bits.T0IE
204 #define EEIE INTCON_bits.EEIE
205 #define GIE INTCON_bits.GIE
206 #endif /* NO_BIT_DEFINES */
208 // ----- OPTION_REG bits --------------------
215 unsigned char T0SE:1;
216 unsigned char T0CS:1;
217 unsigned char INTEDG:1;
218 unsigned char NOT_RBPU:1;
220 } __OPTION_REG_bits_t;
221 extern volatile __OPTION_REG_bits_t __at(OPTION_REG_ADDR) OPTION_REG_bits;
223 #ifndef NO_BIT_DEFINES
224 #define PS0 OPTION_REG_bits.PS0
225 #define PS1 OPTION_REG_bits.PS1
226 #define PS2 OPTION_REG_bits.PS2
227 #define PSA OPTION_REG_bits.PSA
228 #define T0SE OPTION_REG_bits.T0SE
229 #define T0CS OPTION_REG_bits.T0CS
230 #define INTEDG OPTION_REG_bits.INTEDG
231 #define NOT_RBPU OPTION_REG_bits.NOT_RBPU
232 #endif /* NO_BIT_DEFINES */
234 // ----- PORTA bits --------------------
247 extern volatile __PORTA_bits_t __at(PORTA_ADDR) PORTA_bits;
249 #ifndef NO_BIT_DEFINES
250 #define RA0 PORTA_bits.RA0
251 #define RA1 PORTA_bits.RA1
252 #define RA2 PORTA_bits.RA2
253 #define RA3 PORTA_bits.RA3
254 #define RA4 PORTA_bits.RA4
255 #define RA5 PORTA_bits.RA5
256 #endif /* NO_BIT_DEFINES */
258 // ----- PORTB bits --------------------
271 extern volatile __PORTB_bits_t __at(PORTB_ADDR) PORTB_bits;
273 #ifndef NO_BIT_DEFINES
274 #define RB0 PORTB_bits.RB0
275 #define RB1 PORTB_bits.RB1
276 #define RB2 PORTB_bits.RB2
277 #define RB3 PORTB_bits.RB3
278 #define RB4 PORTB_bits.RB4
279 #define RB5 PORTB_bits.RB5
280 #define RB6 PORTB_bits.RB6
281 #define RB7 PORTB_bits.RB7
282 #endif /* NO_BIT_DEFINES */
284 // ----- STATUS bits --------------------
290 unsigned char NOT_PD:1;
291 unsigned char NOT_TO:1;
297 extern volatile __STATUS_bits_t __at(STATUS_ADDR) STATUS_bits;
299 #ifndef NO_BIT_DEFINES
300 #define C STATUS_bits.C
301 #define DC STATUS_bits.DC
302 #define Z STATUS_bits.Z
303 #define NOT_PD STATUS_bits.NOT_PD
304 #define NOT_TO STATUS_bits.NOT_TO
305 #define RP0 STATUS_bits.RP0
306 #define RP1 STATUS_bits.RP1
307 #define IRP STATUS_bits.IRP
308 #endif /* NO_BIT_DEFINES */
310 // ----- TRISA bits --------------------
313 unsigned char TRISA0:1;
314 unsigned char TRISA1:1;
315 unsigned char TRISA2:1;
316 unsigned char TRISA3:1;
317 unsigned char TRISA4:1;
318 unsigned char TRISA5:1;
323 extern volatile __TRISA_bits_t __at(TRISA_ADDR) TRISA_bits;
325 #ifndef NO_BIT_DEFINES
326 #define TRISA0 TRISA_bits.TRISA0
327 #define TRISA1 TRISA_bits.TRISA1
328 #define TRISA2 TRISA_bits.TRISA2
329 #define TRISA3 TRISA_bits.TRISA3
330 #define TRISA4 TRISA_bits.TRISA4
331 #define TRISA5 TRISA_bits.TRISA5
332 #endif /* NO_BIT_DEFINES */
334 // ----- TRISB bits --------------------
337 unsigned char TRISB0:1;
338 unsigned char TRISB1:1;
339 unsigned char TRISB2:1;
340 unsigned char TRISB3:1;
341 unsigned char TRISB4:1;
342 unsigned char TRISB5:1;
343 unsigned char TRISB6:1;
344 unsigned char TRISB7:1;
347 extern volatile __TRISB_bits_t __at(TRISB_ADDR) TRISB_bits;
349 #ifndef NO_BIT_DEFINES
350 #define TRISB0 TRISB_bits.TRISB0
351 #define TRISB1 TRISB_bits.TRISB1
352 #define TRISB2 TRISB_bits.TRISB2
353 #define TRISB3 TRISB_bits.TRISB3
354 #define TRISB4 TRISB_bits.TRISB4
355 #define TRISB5 TRISB_bits.TRISB5
356 #define TRISB6 TRISB_bits.TRISB6
357 #define TRISB7 TRISB_bits.TRISB7
358 #endif /* NO_BIT_DEFINES */