2 // Register Declarations for Microchip 12F629 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 GPIO_ADDR 0x0005
34 #define PCLATH_ADDR 0x000A
35 #define INTCON_ADDR 0x000B
36 #define PIR1_ADDR 0x000C
37 #define TMR1L_ADDR 0x000E
38 #define TMR1H_ADDR 0x000F
39 #define T1CON_ADDR 0x0010
40 #define CMCON_ADDR 0x0019
41 #define OPTION_REG_ADDR 0x0081
42 #define TRISIO_ADDR 0x0085
43 #define PIE1_ADDR 0x008C
44 #define PCON_ADDR 0x008E
45 #define OSCCAL_ADDR 0x0090
46 #define WPU_ADDR 0x0095
47 #define IOCB_ADDR 0x0096
48 #define IOC_ADDR 0x0096
49 #define VRCON_ADDR 0x0099
50 #define EEDATA_ADDR 0x009A
51 #define EEDAT_ADDR 0x009A
52 #define EEADR_ADDR 0x009B
53 #define EECON1_ADDR 0x009C
54 #define EECON2_ADDR 0x009D
57 // Memory organization.
63 // P12F629.INC Standard Header File, Version 1.04 Microchip Technology, Inc.
66 // This header file defines configurations, registers, and other useful bits of
67 // information for the PIC12F629 microcontroller. These names are taken to match
68 // the data sheets as closely as possible.
70 // Note that the processor must be selected before this file is
71 // included. The processor may be selected the following ways:
73 // 1. Command line switch:
74 // C:\ MPASM MYFILE.ASM /PIC12F629
75 // 2. LIST directive in the source file
77 // 3. Processor Type entry in the MPASM full-screen interface
79 //==========================================================================
83 //==========================================================================
84 //1.04 07/01/02 Updated configuration bit names
85 //1.03 05/10/02 Added IOC register
86 //1.02 02/28/02 Updated per datasheet
87 //1.01 01/31/02 Updated per datasheet
88 //1.00 08/24/01 Original
90 //==========================================================================
94 //==========================================================================
97 // MESSG "Processor-header file mismatch. Verify selected processor."
100 //==========================================================================
102 // Register Definitions
104 //==========================================================================
109 //----- Register Files------------------------------------------------------
111 extern __data __at (INDF_ADDR) volatile char INDF;
112 extern __sfr __at (TMR0_ADDR) TMR0;
113 extern __data __at (PCL_ADDR) volatile char PCL;
114 extern __sfr __at (STATUS_ADDR) STATUS;
115 extern __sfr __at (FSR_ADDR) FSR;
116 extern __sfr __at (GPIO_ADDR) GPIO;
118 extern __sfr __at (PCLATH_ADDR) PCLATH;
119 extern __sfr __at (INTCON_ADDR) INTCON;
120 extern __sfr __at (PIR1_ADDR) PIR1;
122 extern __sfr __at (TMR1L_ADDR) TMR1L;
123 extern __sfr __at (TMR1H_ADDR) TMR1H;
124 extern __sfr __at (T1CON_ADDR) T1CON;
126 extern __sfr __at (CMCON_ADDR) CMCON;
128 extern __sfr __at (OPTION_REG_ADDR) OPTION_REG;
130 extern __sfr __at (TRISIO_ADDR) TRISIO;
132 extern __sfr __at (PIE1_ADDR) PIE1;
134 extern __sfr __at (PCON_ADDR) PCON;
136 extern __sfr __at (OSCCAL_ADDR) OSCCAL;
138 extern __sfr __at (WPU_ADDR) WPU;
139 extern __sfr __at (IOCB_ADDR) IOCB;
140 extern __sfr __at (IOC_ADDR) IOC;
142 extern __sfr __at (VRCON_ADDR) VRCON;
143 extern __sfr __at (EEDATA_ADDR) EEDATA;
144 extern __sfr __at (EEDAT_ADDR) EEDAT;
145 extern __sfr __at (EEADR_ADDR) EEADR;
146 extern __sfr __at (EECON1_ADDR) EECON1;
147 extern __sfr __at (EECON2_ADDR) EECON2;
149 //----- STATUS Bits --------------------------------------------------------
152 //----- GPIO Bits --------------------------------------------------------
157 //----- INTCON Bits --------------------------------------------------------
160 //----- PIR1 Bits ----------------------------------------------------------
163 //----- T1CON Bits ---------------------------------------------------------
166 //----- COMCON Bits --------------------------------------------------------
169 //----- OPTION Bits --------------------------------------------------------
172 //----- PIE1 Bits ----------------------------------------------------------
175 //----- PCON Bits ----------------------------------------------------------
178 //----- OSCCAL Bits --------------------------------------------------------
181 //----- IOCB Bits --------------------------------------------------------
184 //----- IOC Bits --------------------------------------------------------
187 //----- VRCON Bits ---------------------------------------------------------
190 //----- EECON1 -------------------------------------------------------------
193 //==========================================================================
197 //==========================================================================
200 // __BADRAM H'06'-H'09', H'0D', H'11'-H'18', H'1A'-H'1F', H'60'-H'7F'
201 // __BADRAM H'86'-H'89', H'8D', H'8F', H'91'-H'94', H'97'-H'98', H'9E'-H'9F', H'E0'-H'FF'
203 //==========================================================================
205 // Configuration Bits
207 //==========================================================================
209 #define _CPD_ON 0x3EFF
210 #define _CPD_OFF 0x3FFF
211 #define _CP_ON 0x3F7F
212 #define _CP_OFF 0x3FFF
213 #define _BODEN_ON 0x3FFF
214 #define _BODEN_OFF 0x3FBF
215 #define _MCLRE_ON 0x3FFF
216 #define _MCLRE_OFF 0x3FDF
217 #define _PWRTE_OFF 0x3FFF
218 #define _PWRTE_ON 0x3FEF
219 #define _WDT_ON 0x3FFF
220 #define _WDT_OFF 0x3FF7
221 #define _LP_OSC 0x3FF8
222 #define _XT_OSC 0x3FF9
223 #define _HS_OSC 0x3FFA
224 #define _EC_OSC 0x3FFB
225 #define _INTRC_OSC_NOCLKOUT 0x3FFC
226 #define _INTRC_OSC_CLKOUT 0x3FFD
227 #define _EXTRC_OSC_NOCLKOUT 0x3FFE
228 #define _EXTRC_OSC_CLKOUT 0x3FFF
232 // ----- CMCON bits --------------------
239 unsigned char CINV:1;
241 unsigned char COUT:1;
245 extern volatile __CMCON_bits_t __at(CMCON_ADDR) CMCON_bits;
247 #define CM0 CMCON_bits.CM0
248 #define CM1 CMCON_bits.CM1
249 #define CM2 CMCON_bits.CM2
250 #define CIS CMCON_bits.CIS
251 #define CINV CMCON_bits.CINV
252 #define COUT CMCON_bits.COUT
254 // ----- EECON1 bits --------------------
259 unsigned char WREN:1;
260 unsigned char WRERR:1;
267 extern volatile __EECON1_bits_t __at(EECON1_ADDR) EECON1_bits;
269 #define RD EECON1_bits.RD
270 #define WR EECON1_bits.WR
271 #define WREN EECON1_bits.WREN
272 #define WRERR EECON1_bits.WRERR
274 // ----- GPIO bits --------------------
287 unsigned char GPIO0:1;
288 unsigned char GPIO1:1;
289 unsigned char GPIO2:1;
290 unsigned char GPIO3:1;
291 unsigned char GPIO4:1;
292 unsigned char GPIO5:1;
297 extern volatile __GPIO_bits_t __at(GPIO_ADDR) GPIO_bits;
299 #define GP0 GPIO_bits.GP0
300 #define GPIO0 GPIO_bits.GPIO0
301 #define GP1 GPIO_bits.GP1
302 #define GPIO1 GPIO_bits.GPIO1
303 #define GP2 GPIO_bits.GP2
304 #define GPIO2 GPIO_bits.GPIO2
305 #define GP3 GPIO_bits.GP3
306 #define GPIO3 GPIO_bits.GPIO3
307 #define GP4 GPIO_bits.GP4
308 #define GPIO4 GPIO_bits.GPIO4
309 #define GP5 GPIO_bits.GP5
310 #define GPIO5 GPIO_bits.GPIO5
312 // ----- INTCON bits --------------------
315 unsigned char GPIF:1;
316 unsigned char INTF:1;
317 unsigned char T0IF:1;
318 unsigned char GPIE:1;
319 unsigned char INTE:1;
320 unsigned char T0IE:1;
321 unsigned char PEIE:1;
325 extern volatile __INTCON_bits_t __at(INTCON_ADDR) INTCON_bits;
327 #define GPIF INTCON_bits.GPIF
328 #define INTF INTCON_bits.INTF
329 #define T0IF INTCON_bits.T0IF
330 #define GPIE INTCON_bits.GPIE
331 #define INTE INTCON_bits.INTE
332 #define T0IE INTCON_bits.T0IE
333 #define PEIE INTCON_bits.PEIE
334 #define GIE INTCON_bits.GIE
336 // ----- IOC bits --------------------
339 unsigned char IOC0:1;
340 unsigned char IOC1:1;
341 unsigned char IOC2:1;
342 unsigned char IOC3:1;
343 unsigned char IOC4:1;
344 unsigned char IOC5:1;
349 extern volatile __IOC_bits_t __at(IOC_ADDR) IOC_bits;
351 #define IOC0 IOC_bits.IOC0
352 #define IOC1 IOC_bits.IOC1
353 #define IOC2 IOC_bits.IOC2
354 #define IOC3 IOC_bits.IOC3
355 #define IOC4 IOC_bits.IOC4
356 #define IOC5 IOC_bits.IOC5
358 // ----- IOCB bits --------------------
361 unsigned char IOCB0:1;
362 unsigned char IOCB1:1;
363 unsigned char IOCB2:1;
364 unsigned char IOCB3:1;
365 unsigned char IOCB4:1;
366 unsigned char IOCB5:1;
371 extern volatile __IOCB_bits_t __at(IOCB_ADDR) IOCB_bits;
373 #define IOCB0 IOCB_bits.IOCB0
374 #define IOCB1 IOCB_bits.IOCB1
375 #define IOCB2 IOCB_bits.IOCB2
376 #define IOCB3 IOCB_bits.IOCB3
377 #define IOCB4 IOCB_bits.IOCB4
378 #define IOCB5 IOCB_bits.IOCB5
380 // ----- OPTION_REG bits --------------------
387 unsigned char T0SE:1;
388 unsigned char T0CS:1;
389 unsigned char INTEDG:1;
390 unsigned char NOT_GPPU:1;
392 } __OPTION_REG_bits_t;
393 extern volatile __OPTION_REG_bits_t __at(OPTION_REG_ADDR) OPTION_REG_bits;
395 #define PS0 OPTION_REG_bits.PS0
396 #define PS1 OPTION_REG_bits.PS1
397 #define PS2 OPTION_REG_bits.PS2
398 #define PSA OPTION_REG_bits.PSA
399 #define T0SE OPTION_REG_bits.T0SE
400 #define T0CS OPTION_REG_bits.T0CS
401 #define INTEDG OPTION_REG_bits.INTEDG
402 #define NOT_GPPU OPTION_REG_bits.NOT_GPPU
404 // ----- OSCCAL bits --------------------
409 unsigned char CAL0:1;
410 unsigned char CAL1:1;
411 unsigned char CAL2:1;
412 unsigned char CAL3:1;
413 unsigned char CAL4:1;
414 unsigned char CAL5:1;
417 extern volatile __OSCCAL_bits_t __at(OSCCAL_ADDR) OSCCAL_bits;
419 #define CAL0 OSCCAL_bits.CAL0
420 #define CAL1 OSCCAL_bits.CAL1
421 #define CAL2 OSCCAL_bits.CAL2
422 #define CAL3 OSCCAL_bits.CAL3
423 #define CAL4 OSCCAL_bits.CAL4
424 #define CAL5 OSCCAL_bits.CAL5
426 // ----- PCON bits --------------------
429 unsigned char NOT_BOD:1;
430 unsigned char NOT_POR:1;
439 extern volatile __PCON_bits_t __at(PCON_ADDR) PCON_bits;
441 #define NOT_BOD PCON_bits.NOT_BOD
442 #define NOT_POR PCON_bits.NOT_POR
444 // ----- PIE1 bits --------------------
447 unsigned char T1IE:1;
450 unsigned char CMIE:1;
453 unsigned char ADIE:1;
454 unsigned char EEIE:1;
457 unsigned char TMR1IE:1;
467 extern volatile __PIE1_bits_t __at(PIE1_ADDR) PIE1_bits;
469 #define T1IE PIE1_bits.T1IE
470 #define TMR1IE PIE1_bits.TMR1IE
471 #define CMIE PIE1_bits.CMIE
472 #define ADIE PIE1_bits.ADIE
473 #define EEIE PIE1_bits.EEIE
475 // ----- PIR1 bits --------------------
478 unsigned char T1IF:1;
481 unsigned char CMIF:1;
484 unsigned char ADIF:1;
485 unsigned char EEIF:1;
488 unsigned char TMR1IF:1;
498 extern volatile __PIR1_bits_t __at(PIR1_ADDR) PIR1_bits;
500 #define T1IF PIR1_bits.T1IF
501 #define TMR1IF PIR1_bits.TMR1IF
502 #define CMIF PIR1_bits.CMIF
503 #define ADIF PIR1_bits.ADIF
504 #define EEIF PIR1_bits.EEIF
506 // ----- STATUS bits --------------------
512 unsigned char NOT_PD:1;
513 unsigned char NOT_TO:1;
519 extern volatile __STATUS_bits_t __at(STATUS_ADDR) STATUS_bits;
521 #define C STATUS_bits.C
522 #define DC STATUS_bits.DC
523 #define Z STATUS_bits.Z
524 #define NOT_PD STATUS_bits.NOT_PD
525 #define NOT_TO STATUS_bits.NOT_TO
526 #define RP0 STATUS_bits.RP0
527 #define RP1 STATUS_bits.RP1
528 #define IRP STATUS_bits.IRP
530 // ----- T1CON bits --------------------
533 unsigned char TMR1ON:1;
534 unsigned char TMR1CS:1;
535 unsigned char NOT_T1SYNC:1;
536 unsigned char T1OSCEN:1;
537 unsigned char T1CKPS0:1;
538 unsigned char T1CKPS1:1;
539 unsigned char TMR1GE:1;
543 extern volatile __T1CON_bits_t __at(T1CON_ADDR) T1CON_bits;
545 #define TMR1ON T1CON_bits.TMR1ON
546 #define TMR1CS T1CON_bits.TMR1CS
547 #define NOT_T1SYNC T1CON_bits.NOT_T1SYNC
548 #define T1OSCEN T1CON_bits.T1OSCEN
549 #define T1CKPS0 T1CON_bits.T1CKPS0
550 #define T1CKPS1 T1CON_bits.T1CKPS1
551 #define TMR1GE T1CON_bits.TMR1GE
553 // ----- VRCON bits --------------------
563 unsigned char VREN:1;
566 extern volatile __VRCON_bits_t __at(VRCON_ADDR) VRCON_bits;
568 #define VR0 VRCON_bits.VR0
569 #define VR1 VRCON_bits.VR1
570 #define VR2 VRCON_bits.VR2
571 #define VR3 VRCON_bits.VR3
572 #define VRR VRCON_bits.VRR
573 #define VREN VRCON_bits.VREN