1 /*-------------------------------------------------------------------------
2 mcs51reg.h - Register Declarations for the mcs51 compatible
5 Copyright (C) 2000, Bela Torok / bela.torok@kssg.ch
7 This library is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this library; see the file COPYING. If not, write to the
19 Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
22 As a special exception, if you link this library with other files,
23 some of which are compiled with SDCC, to produce an executable,
24 this library does not by itself cause the resulting executable to
25 be covered by the GNU General Public License. This exception does
26 not however invalidate any other reasons why the executable file
27 might be covered by the GNU General Public License.
28 -------------------------------------------------------------------------*/
30 /*-------------------------------------------------------------------------
33 Version 1.0 Nov 2, 2000 - B. Torok / bela.torok@kssg.ch
34 Initial release, supported microcontrollers:
35 8051, 8052, Atmel AT89C1051, AT89C2051, AT89C4051,
36 Infineon / Siemens SAB80515, SAB80535, SAB80515A
38 Version 1.0.1 (Nov 3, 2000)
39 SAB80515A definitions revised by Michael Schmitt / michael.schmitt@t-online.de
41 Version 1.0.2 (Nov 6, 2000)
42 T2CON bug corrected 8052 and SABX microcontrollers have different T2CONs
43 Support for the Atmel AT89C52, AT80LV52, AT89C55, AT80LV55
44 Support for the Dallas DS80C320 and DS80C323
45 B. Torok / bela.torok@kssg.ch
47 Version 1.0.3 (Nov 7, 2000)
48 SAB80517 definitions added by Michael Schmitt / michael.schmitt@t-online.de
49 Dallas AT89S53 definitions added by B. Torok / bela.torok@kssg.ch
50 Dallas DS87C520 and DS83C520 definitions added by B. Torok / bela.torok@kssg.ch
52 Version 1.0.4 (Nov 9, 2000)
53 To simplify the identication of registers, a large number of definitios
54 were renamed. Long register names now (hopefully) clearly define the
55 function of the registers.
56 Dallas DS89C420 definitions added by B. Torok / bela.torok@kssg.ch
58 Version 1.0.5 (Dec 15, 2000)
59 Definitions added: #ifdef MCS51REG_EXTERNAL_ROM
60 #ifdef MCS51REG_EXTERNAL_RAM
61 #ifndef MCS51REG_DISABLE_WARNINGS
64 Version 1.0.6 (March 10, 2001)
65 Support for the Dallas DS5000 & DS2250
66 Support for the Dallas DS5001 & DS2251
67 Support for the Dallas DS80C390
68 microcontrollers - B. Torok / bela.torok@kssg.ch
70 Version 1.0.7 (June 7, 2001)
71 #ifndef MCS51REG_DISABLE_WARNINGS removed
72 #ifdef MCS51REG_DISABLE_WARNINGS added - B. Torok / bela.torok@kssg.ch
73 Support for the Philips P80C552 added - Bernhard Held / Bernhard.Held@otelo-online.de
75 Version 1.0.8 (Feb 28, 2002)
76 Dallas DS89C420 definitions corrected by B. Torok / bela.torok@kssg.ch
77 Revised by lanius@ewetel.net
79 Version 1.0.9 (Sept 9, 2002)
80 Register declarations for the Atmel T89C51RD2 added by Johannes Hoelzl / johannes.hoelzl@gmx.de
82 Version 1.0.10 (Sept 19, 2002)
83 Register declarations for the Philips P89C668 added by Eric Limpens / Eric@limpens.net
85 Version 1.0.11 (Sept 19, 2004)
86 Dallas DS5000 MCON Register declarations corrected by Radek Zadera / a2i@swipnet.se
88 Version 1.0.12 (March 2, 2005)
89 Infineon SAB80C509 Register declarations added Thomas Boje / thomas@boje.name
91 Adding support for additional microcontrollers:
92 -----------------------------------------------
94 1. Don't modify this file!!!
96 2. Insert your code in a separate file e.g.: mcs51reg_update.h and include
97 this after the #define HEADER_MCS51REG statement in this file
99 3. The mcs51reg_update.h file should contain following definitions:
101 a. An entry with the inventory of the register set of the
102 microcontroller in the "Describe microcontrollers" section.
104 b. If necessary add entry(s) for registers not defined in this file
106 c. Define interrupt vectors
108 4. Compile a program for the microcontroller using the Preprocessor only, e.g.:,
109 sdcc -E test.c > t.txt
110 and check definitions for validity in the t.txt file.
112 5. If everithing seems to be OK send me the mcs51reg_update.h file. --> bela.torok@kssg.ch
113 I'm going to resolve conflicts & verify/merge new definitions to this file.
116 Microcontroller support:
118 Use one of the following options:
120 1. use #include <mcs51reg.h> in your program & define MICROCONTROLLER_XXXX in your makefile.
122 2. use following definitions prior the
123 #include <mcs51reg.h> line in your program:
125 #define MICROCONTROLLER_8052 -> 8052 type microcontroller
127 #define MICROCONTROLLER_AT89CX051 -> Atmel AT89C1051, AT89C2051 and AT89C4051 microcontrollers
130 Use only one of the following definitions!!!
132 Supported Microcontrollers:
135 MICROCONTROLLER_8051 8051
136 MICROCONTROLLER_8052 8052
137 MICROCONTROLLER_AT89CX051 Atmel AT89C1051, AT89C2051 and AT89C4051
138 MICROCONTROLLER_AT89S53 Atmel AT89S53 microcontroller
139 MICROCONTROLLER_AT89X52 Atmel AT89C52 and AT80LV52 microcontrollers
140 MICROCONTROLLER_AT89X55 Atmel AT89C55 and AT80LV55 microcontrollers
141 MICROCONTROLLER_DS5000 Dallas DS5000 & DS2250 microcontroller
142 MICROCONTROLLER_DS5001 Dallas DS5001 & DS2251 microcontroller
143 MICROCONTROLLER_DS80C32X Dallas DS80C320 and DS80C323 microcontrollers
144 MICROCONTROLLER_DS80C390 Dallas DS80C390 microcontroller
145 MICROCONTROLLER_DS89C420 Dallas DS89C420 microcontroller
146 MICROCONTROLLER_DS8XC520 Dallas DS87C520 and DS83C520 microcontrollers
147 MICROCONTROLLER_P80C552 Philips P80C552
148 MICROCONTROLLER_P89C668 Philips P89C668
149 MICROCONTROLLER_SAB80C509 Infineon / Siemens SAB80C509
150 MICROCONTROLLER_SAB80515 Infineon / Siemens SAB80515 & SAB80535
151 MICROCONTROLLER_SAB80515A Infineon / Siemens SAB80515A
152 MICROCONTROLLER_SAB80517 Infineon / Siemens SAB80517
153 MICROCONTROLLER_T89C51RD2 Atmel T89C51RD2
155 Additional definitions (use them prior the #include mcs51reg.h statement):
157 Ports P0 & P2 are not available if external ROM used.
158 Use statement "#define MCS51REG_EXTERNAL_ROM" to undefine P0 & P2.
160 Ports P0, P2, P3_6, WR, P3_7 & RD are not available if external RAM is used.
161 Use statement "#define MCS51REG_EXTERNAL_RAM" to undefine P0, P2,
164 #define MCS51REG_ENABLE_WARNINGS -> enable warnings
166 -----------------------------------------------------------------------*/
169 #ifndef HEADER_MCS51REG
170 #define HEADER_MCS51REG
172 #include <compiler.h>
174 ///////////////////////////////////////////////////////
175 /// Insert header here (for developers only) ///
176 /// remove "//" from the begining of the next line ///
177 //#include "mcs51reg_update.h" ///
178 ///////////////////////////////////////////////////////
180 //////////////////////////////////
181 /// Describe microcontrollers ///
182 /// (inventory of registers) ///
183 //////////////////////////////////
185 // definitions for the 8051
186 #ifdef MICROCONTROLLER_8051
187 #ifdef MICROCONTROLLER_DEFINED
188 #define MCS51REG_ERROR
190 #ifndef MICROCONTROLLER_DEFINED
191 #define MICROCONTROLLER_DEFINED
193 #ifdef MCS51REG_ENABLE_WARNINGS
194 #warning Selected HW: 8051
200 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
211 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
213 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
218 // end of definitions for the 8051
221 // definitions for the 8052 microcontroller
222 #ifdef MICROCONTROLLER_8052
223 #ifdef MICROCONTROLLER_DEFINED
224 #define MCS51REG_ERROR
226 #ifndef MICROCONTROLLER_DEFINED
227 #define MICROCONTROLLER_DEFINED
229 #ifdef MCS51REG_ENABLE_WARNINGS
230 #warning Selected HW: 8052
237 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
248 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
250 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
254 // 8052 specific registers
255 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
261 // end of definitions for the 8052 microcontroller
264 // definitionsons for the Atmel
265 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
266 #ifdef MICROCONTROLLER_AT89CX051
267 #ifdef MICROCONTROLLER_DEFINED
268 #define MCS51REG_ERROR
270 #ifndef MICROCONTROLLER_DEFINED
271 #define MICROCONTROLLER_DEFINED
273 #ifdef MCS51REG_ENABLE_WARNINGS
274 #warning Selected HW: Atmel AT89Cx051
276 // 8051 register set without P0 & P2
280 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
290 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
292 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
297 // end of definitionsons for the Atmel
298 // AT89C1051, AT89C2051 and AT89C4051 microcontrollers
301 // definitions for the Atmel AT89S53
302 #ifdef MICROCONTROLLER_AT89S53
303 #ifdef MICROCONTROLLER_DEFINED
304 #define MCS51REG_ERROR
306 #ifndef MICROCONTROLLER_DEFINED
307 #define MICROCONTROLLER_DEFINED
309 #ifdef MCS51REG_ENABLE_WARNINGS
310 #warning Selected HW: AT89S53
317 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
328 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
330 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
334 // 8052 specific registers
335 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
340 // AT89S53 specific register
341 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
342 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
350 // end of definitions for the Atmel AT89S53 microcontroller
353 // definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
354 #ifdef MICROCONTROLLER_AT89X52
355 #ifdef MICROCONTROLLER_DEFINED
356 #define MCS51REG_ERROR
358 #ifndef MICROCONTROLLER_DEFINED
359 #define MICROCONTROLLER_DEFINED
361 #ifdef MCS51REG_ENABLE_WARNINGS
362 #warning Selected HW: AT89C52 or AT89LV52
369 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
380 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
382 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
386 // 8052 specific registers
387 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
392 // AT89X55 specific register
393 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
394 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
396 // end of definitions for the Atmel AT89C52 and AT89LV52 microcontrollers
399 // definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
400 #ifdef MICROCONTROLLER_AT89X55
401 #ifdef MICROCONTROLLER_DEFINED
402 #define MCS51REG_ERROR
404 #ifndef MICROCONTROLLER_DEFINED
405 #define MICROCONTROLLER_DEFINED
407 #ifdef MCS51REG_ENABLE_WARNINGS
408 #warning Selected HW: AT89C55 or AT89LV55
415 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
426 #define IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
428 #define IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
432 // 8052 specific registers
433 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
438 // AT89X55 specific register
439 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
440 #define P1_EXT__x__x__x__x__x__x__T2EX__T2
442 // end of definitions for the Atmel AT89C55 and AT89LV55 microcontrollers
445 // definitions for the Dallas DS5000
446 #ifdef MICROCONTROLLER_DS5000
447 #ifdef MICROCONTROLLER_DEFINED
448 #define MCS51REG_ERROR
450 #ifndef MICROCONTROLLER_DEFINED
451 #define MICROCONTROLLER_DEFINED
453 #ifdef MCS51REG_ENABLE_WARNINGS
454 #warning Selected HW: DS5000
460 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
471 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
473 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
474 #define MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
480 // end of definitions for the Dallas DS5000
483 // definitions for the Dallas DS5001
484 #ifdef MICROCONTROLLER_DS5001
485 #ifdef MICROCONTROLLER_DEFINED
486 #define MCS51REG_ERROR
488 #ifndef MICROCONTROLLER_DEFINED
489 #define MICROCONTROLLER_DEFINED
491 #ifdef MCS51REG_ENABLE_WARNINGS
492 #warning Selected HW: DS5001
498 #define PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
509 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
511 #define IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
515 #define MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
520 #define STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
524 // end of definitions for the Dallas DS5001
527 // definitions for the Dallas DS80C320 and DS80C323 microcontrollers
528 #ifdef MICROCONTROLLER_DS80C32X
529 #ifdef MICROCONTROLLER_DEFINED
530 #define MCS51REG_ERROR
532 #ifndef MICROCONTROLLER_DEFINED
533 #define MICROCONTROLLER_DEFINED
535 #ifdef MCS51REG_ENABLE_WARNINGS
536 #warning Selected HW: Dallas DS80C320 or DS80C323
543 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
555 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
557 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
561 // 8052 specific registers
562 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
567 // DS80C320 specific register
570 #define DPS__x__x__x__x__x__x__x__SEL
571 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
572 #define EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
579 #define STATUS__PIP__HIP__LIP__x__x__x__x__x
581 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
582 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
584 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
585 #define EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
587 // end of definitions for the Dallas DS80C320 and DS80C323 microcontrollers
590 // definitions for the Dallas DS80C390
591 #ifdef MICROCONTROLLER_DS80C390
592 #ifdef MICROCONTROLLER_DEFINED
593 #define MCS51REG_ERROR
595 #ifndef MICROCONTROLLER_DEFINED
596 #define MICROCONTROLLER_DEFINED
598 #ifdef MCS51REG_ENABLE_WARNINGS
599 #warning Selected HW: Dallas DS80C390
606 #define PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
618 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
620 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
624 // 8052 specific registers
625 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
630 // DS80C390 specific register
634 #define DPS__ID1__ID0__TSL__x__x__x__x__SEL
635 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
636 #define EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
644 #define ACON__x__x__x__x__x__SA__AM1__AM0
675 #define PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
676 #define STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
677 #define MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
679 #define T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
696 #define EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
707 #define EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
714 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
716 // end of definitions for the Dallas DS80C390
718 // definitions for the Dallas DS89C420 microcontroller
719 #ifdef MICROCONTROLLER_DS89C420
720 #ifdef MICROCONTROLLER_DEFINED
721 #define MCS51REG_ERROR
723 #ifndef MICROCONTROLLER_DEFINED
724 #define MICROCONTROLLER_DEFINED
726 #ifdef MCS51REG_ENABLE_WARNINGS
727 #warning Selected HW: Dallas DS89C420
734 #define PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
746 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
748 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
752 // 8052 specific registers
753 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
758 // DS8XC420 specific registers
759 #define ACON__PAGEE__PAGES1__PAGES0__x__x__x__x__x
762 #define DPS__ID1__ID0__TSL__AID__x__x__x__SEL
763 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
765 #define IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
766 #define IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
767 #define EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
768 #define PMR__CD1__CD0__SWB__CTM__4X_2X__ALEON__DME1__DME0
775 #define STATUS__PIS2__PIS1__PIS0__x__SPTA1__SPRA1__SPTA0__SPRA0
777 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
778 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
779 #define ROMSIZE__x__x__x__x__PRAME__RMS2__RMS1__RMS0
781 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
782 #define EIP0__x__x__x__LPWDI__LPX5__LPX4__LPX3__LPX2
783 #define EIP1__x__x__x__MPWDI__MPX5__MPX4__MPX3__MPX2
784 #define FCNTL__FBUSY__FERR__x__x__FC3__FC2__FC1__FC0
786 // end of definitions for the Dallas DS89C420 microcontroller
788 // definitions for the Dallas DS87C520 and DS83C520 microcontrollers
789 #ifdef MICROCONTROLLER_DS8XC520
790 #ifdef MICROCONTROLLER_DEFINED
791 #define MCS51REG_ERROR
793 #ifndef MICROCONTROLLER_DEFINED
794 #define MICROCONTROLLER_DEFINED
796 #ifdef MCS51REG_ENABLE_WARNINGS
797 #warning Selected HW: Dallas DS87C520 or DS85C520
804 #define PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
816 #define IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
818 #define IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
822 // 8052 specific registers
823 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
828 // DS8XC520 specific registers
831 #define DPS__x__x__x__x__x__x__x__SEL
832 #define CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
833 #define EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
834 #define PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1__DME0
841 #define STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
843 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
844 #define P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
846 #define ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
849 #define EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
850 #define EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
852 // end of definitions for the Dallas DS87C520 and DS83C520 microcontrollers
855 // definitions for the Philips P80C552 microcontroller
856 #ifdef MICROCONTROLLER_P80C552
857 #ifdef MICROCONTROLLER_DEFINED
858 #define MCS51REG_ERROR
860 #ifndef MICROCONTROLLER_DEFINED
861 #define MICROCONTROLLER_DEFINED
863 #ifdef MCS51REG_ENABLE_WARNINGS
864 #warning Selected HW: Philips P80C552
871 #define PCON__SMOD__x__x__WLE__GF1__GF0__PD__IDL
882 #define IE__EA__EAD__ES1__ES0__ET1__EX1__ET0__EX0
884 #define IP__x__PAD__PS1__PS0__PT1__PX1__PT0__PX0
888 // P80C552 specific register-names
889 #define S0BUF // same as SBUF, set in mcs51reg.h
890 #define S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
891 // P80C552 specific registers
893 #define ADCON__ADC_1__ADC_0__ADEX__ADCI__ADCS__AADR2__AADR1__AADR0
894 #define CTCON__CTN3__CTP3__CTN2__CTP2__CTN1__CTP1__CTN0__CTP0
909 #define IEN1__ET2__ECM2__ECM1__ECM0__ECT3__ECT2__ECT1__ECT0
910 #define IP1__PT2__PCM2__PCM1__PCM0__PCT3__PCT2__PCT1__PCT0
914 #define P1_EXT__SDA__SCL__RT2__T2__CT3I__CT2I__CT1I__CT0I
915 #define P4_AT_0XC0__CMT0__CMT1__CMSR5__CMSR4__CMSR3__CMSR2__CMSR1__CMSR0
917 #define RTE__TP47__TP46__RP45__RP44__RP43__RP42__RP41__RP40
918 #define S1ADR__x__x__x__x__x__x__x__GC
919 #define S1DAT_AT_0XDA
920 #define S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
921 #define S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
922 #define STE__TG47__TG46__SP45__SP44__SP43__SP42__SP41__SP40
925 #define TM2CON__T2IS1__T2IS0__T2ER__T2B0__T2P1__T2P0__T2MS1__T2MS0
926 #define TM2IR__T20V__CMI2__CMI1__CMI0__CTI3__CTI2__CTI1__CTI0
929 // end of definitions for the Philips P80C552 microcontroller
932 // definitions for the Philips P89C668
933 #ifdef MICROCONTROLLER_P89C668
934 #ifdef MICROCONTROLLER_DEFINED
935 #define MCS51REG_ERROR
937 #ifndef MICROCONTROLLER_DEFINED
938 #define MICROCONTROLLER_DEFINED
940 #ifdef MCS51REG_ENABLE_WARNINGS
941 #warning Selected HW: P89C668
944 #define P0_EXT__AD7__AD6__AD5__AD4__AD3__AD2__AD1__AD0
946 #define P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
948 #define P2_EXT__AD15__AD14__AD13__AD12__AD11__AD10__AD9__AD8
950 #define P3_EXT__x__x__CEX4__CEX3__x__x__x__x
956 #define PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
962 #define S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
963 #define S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
970 #define SADEN_AT_0XB9
971 #define S1IST_AT_0XDC
972 #define S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
973 #define S1DAT_AT_0XDA
974 #define S1ADR__x__x__x__x__x__x__x__GC
976 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
977 #define T2MOD__x__x__x__x__x__x__T2OE__DCEN
982 #define IEN0__EA__EC__ES1__ES0__ET1__EX1__ET0__EX0
983 #define IEN1__x__x__x__x__x__x__x__ET2
984 #define IP__PT2__PPC__PS1__PS0__PT1__PX1__PT0__PX0
985 #define IPH__PT2H__PPCH__PS1H__PS0H__PT1H__PX1H__PT0H__PX0H
986 #define CCON__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
987 #define CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
988 #define AUXR__x__x__x__x__x__x__EXTRAM__A0
989 #define AUXR1__x__x__ENBOOT__x__GF2__0__x__DPS
990 #define WDTRST_AT_0XA6
991 #define CCAPM0_AT_0XC2
992 #define CCAPM1_AT_0XC3
993 #define CCAPM2_AT_0XC4
994 #define CCAPM3_AT_0XC5
995 #define CCAPM4_AT_0XC6
996 #define CCAP0L_AT_0XEA
997 #define CCAP1L_AT_0XEB
998 #define CCAP2L_AT_0XEC
999 #define CCAP3L_AT_0XED
1000 #define CCAP4L_AT_0XEE
1003 #define CCAP0H_AT_0XFA
1004 #define CCAP1H_AT_0XFB
1005 #define CCAP2H_AT_0XFC
1006 #define CCAP3H_AT_0XFD
1007 #define CCAP4H_AT_0XFE
1009 // end of definitions for the Philips P89C668
1012 // definitions for the Infineon / Siemens SAB80509
1013 #ifdef MICROCONTROLLER_SAB80509
1014 #ifdef MICROCONTROLLER_DEFINED
1015 #define MCS51REG_ERROR
1017 #ifndef MICROCONTROLLER_DEFINED
1018 #define MICROCONTROLLER_DEFINED
1020 #ifdef MCS51REG_ENABLE_WARNINGS
1021 #warning Selected HW: Infineon / Siemens SAB80509
1023 // 8051 register set without IP
1028 #define PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
1038 #define S0CON__SM0__SM1__SM20__REN0__TB80__RB80__TI0__RI0
1039 #define IEN2__SAB80517
1042 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1043 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1047 #define IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
1048 #define IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
1064 #define S1CON_AT_0X9B
1067 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1090 #define CTCOM_AT_0XE1
1141 // end of definitions for the Infineon / Siemens SAB80509
1144 // definitions for the Infineon / Siemens SAB80515 & SAB80535
1145 #ifdef MICROCONTROLLER_SAB80515
1146 #ifdef MICROCONTROLLER_DEFINED
1147 #define MCS51REG_ERROR
1149 #ifndef MICROCONTROLLER_DEFINED
1150 #define MICROCONTROLLER_DEFINED
1152 #ifdef MCS51REG_ENABLE_WARNINGS
1153 #warning Selected HW: Infineon / Siemens SAB80515 & SAB80535
1155 // 8051 register set without IP
1160 #define PCON__SMOD__x__x__x__x__x__x__x
1171 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1176 // SAB80515 specific registers
1177 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
1178 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1179 #define IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
1188 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1195 #define DAPR__SAB80515
1200 // end of definitions for the Infineon / Siemens SAB80515
1203 // definitions for the Infineon / Siemens SAB80515A
1204 #ifdef MICROCONTROLLER_SAB80515A
1205 #ifdef MICROCONTROLLER_DEFINED
1206 #define MCS51REG_ERROR
1208 #ifndef MICROCONTROLLER_DEFINED
1209 #define MICROCONTROLLER_DEFINED
1211 #ifdef MCS51REG_ENABLE_WARNINGS
1212 #warning Selected HW: Infineon / Siemens SAB80515A
1214 // 8051 register set without IP
1219 #define PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
1230 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1235 // SAB80515A specific registers
1236 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
1237 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1238 #define IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
1239 #define IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
1248 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1265 // end of definitions for the Infineon / Siemens SAB80515A
1268 // definitions for the Infineon / Siemens SAB80517
1269 #ifdef MICROCONTROLLER_SAB80517
1270 #ifdef MICROCONTROLLER_DEFINED
1271 #define MCS51REG_ERROR
1273 #ifndef MICROCONTROLLER_DEFINED
1274 #define MICROCONTROLLER_DEFINED
1276 #ifdef MCS51REG_ENABLE_WARNINGS
1277 #warning Selected HW: Infineon / Siemens SAB80517
1279 // 8051 register set without IP, SCON & SBUF
1284 #define PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
1295 #define IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
1300 // SAB80517 specific registers
1301 #define P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
1302 #define IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
1303 #define IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
1304 #define IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
1305 #define IEN2__SAB80517
1335 #define T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
1338 #define CTCOM_AT_0XE1
1346 #define DAPR__SAB80517
1361 #define S0CON__SM0__SM1__SM20__REN0__TB80__RB80__TI0__RI0
1365 #define S1CON_AT_0X9B
1372 // end of definitions for the Infineon / Siemens SAB80517
1375 // definitions for the Atmel T89C51RD2
1376 #ifdef MICROCONTROLLER_T89C51RD2
1377 #ifdef MICROCONTROLLER_DEFINED
1378 #define MCS51REG_ERROR
1380 #ifndef MICROCONTROLLER_DEFINED
1381 #define MICROCONTROLLER_DEFINED
1383 #ifdef MCS51REG_ENABLE_WARNINGS
1384 #warning Selected HW: T89C51RD2
1387 // 8051 register set
1392 #define PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
1403 #define IE__EA__EC__ET2__ES__ET1__EX1__ET0__EX0
1406 #define IP__x__PPC__PT2__PS__PT1__PX1__PT0__PX0
1411 // 8052 register set
1412 #define T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
1418 // T89C51RD2 register set
1419 #define P4_AT_0XC0__P4_7__P4_6__P4_5__P4_3__P4_2__P4_1__P4_0
1423 #define AUXR1__x__x__x__x__GF3__x__x__DPS
1424 #define WDTRST_AT_0XA6
1425 #define WDTPRG_AT_0XA7
1426 #define AUXR__x__x__M0__x__XRS1__XRS0__EXTRAM__A0
1427 #define IPH__x__PPCH__PT2H__PSH__PT1H__PX1H__PT0H__PX0H
1431 #define CKCON__X2__T0X2__T1X2__T2X2__SiX2__PcaX2__WdX2__x
1432 #define CCON__0xD8__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
1433 #define CMOD__0xD9__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
1434 #define CCAPM0_AT_0XDA
1435 #define CCAPM1_AT_0XDB
1436 #define CCAPM2_AT_0XDC
1437 #define CCAPM3_AT_0XDD
1438 #define CCAPM4_AT_0XDE
1440 #define CCAP0L_AT_0XEA
1441 #define CCAP1L_AT_0XEB
1442 #define CCAP2L_AT_0XEC
1443 #define CCAP3L_AT_0XED
1444 #define CCAP4L_AT_0XEE
1446 #define CCAP0H_AT_0XFA
1447 #define CCAP1H_AT_0XFB
1448 #define CCAP2H_AT_0XFC
1449 #define CCAP3H_AT_0XFD
1450 #define CCAP4H_AT_0XFE
1451 #endif /* MICROCONTROLLER_T89C51RD2 */
1452 /* end of definition for the Atmel T89C51RD2 */
1455 /////////////////////////////////////////////////////////
1456 /// don't specify microcontrollers below this line! ///
1457 /////////////////////////////////////////////////////////
1460 // default microcontroller -> 8051
1461 // use default if no microcontroller specified
1462 #ifndef MICROCONTROLLER_DEFINED
1463 #define MICROCONTROLLER_DEFINED
1464 #ifdef MCS51REG_ENABLE_WARNINGS
1465 #warning No microcontroller defined!
1466 #warning Code generated for the 8051
1468 // 8051 register set
1473 #define PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
1484 #define IE__EA__x__x__ES__ET1__EX1__ET0__EX0
1486 #define IP__x__x__x__PS__PT1__PX1__PT0__PX0
1491 // end of definitions for the default microcontroller
1494 #ifdef MCS51REG_ERROR
1495 #error Two or more microcontrollers defined!
1498 #ifdef MCS51REG_EXTERNAL_ROM
1499 #ifndef MCS51REG_UNDEFINE_P0
1500 #define MCS51REG_UNDEFINE_P0
1502 #ifndef MCS51REG_UNDEFINE_P2
1503 #define MCS51REG_UNDEFINE_P2
1507 #ifdef MCS51REG_EXTERNAL_RAM
1508 #ifndef MCS51REG_UNDEFINE_P0
1509 #define MCS51REG_UNDEFINE_P0
1511 #ifndef MCS51REG_UNDEFINE_P2
1512 #define MCS51REG_UNDEFINE_P2
1516 #ifdef MCS51REG_UNDEFINE_P0
1520 #ifdef MCS51REG_UNDEFINE_P2
1524 ////////////////////////////////
1525 /// Register definitions ///
1526 /// (In alphabetical order) ///
1527 ////////////////////////////////
1534 #ifdef ACON__PAGEE__PAGES1__PAGES0__x__x__x__x__x
1535 #undef ACON__PAGEE__PAGES1__PAGES0__x__x__x__x__x
1536 SFR(ACON
, 0x9D); // DS89C420 specific
1537 // Not directly accessible bits
1543 #ifdef ACON__x__x__x__x__x__SA__AM1__AM0
1544 #undef ACON__x__x__x__x__x__SA__AM1__AM0
1545 SFR(ACON
, 0x9D); // DS89C390 specific
1546 // Not directly accessible bits
1554 SFR(ADCH
, 0xC6); // A/D converter high
1559 SFR(ADCON
, 0xD8); // A/D-converter control register SAB80515 specific
1570 // ADCON0 ... Infineon / Siemens also called this register ADCON in the User Manual
1573 SFR(ADCON0
, 0xD8); // A/D-converter control register 0 SAB80515A &
1574 // Bit registers // SAB80517 specific
1580 SBIT(ADEX
, 0xD8, 5);
1583 // Not directly accessible ADCON0
1584 #define ADCON0_MX0 0x01
1585 #define ADCON0_MX1 0x02
1586 #define ADCON0_MX2 0x04
1587 #define ADCON0_ADM 0x08
1588 #define ADCON0_BSY 0x10
1589 #define ADCON0_ADEX 0x20
1590 #define ADCON0_CLK 0x40
1591 #define ADCON0_BD 0x80
1596 SFR(ADCON1
, 0xDC); // A/D-converter control register 1 SAB80515A & SAB80517 specific
1597 // Not directly accessible ADCON1
1598 #define ADCON1_MX0 0x01
1599 #define ADCON1_MX1 0x02
1600 #define ADCON1_MX2 0x04
1601 #define ADCON1_ADCL 0x80
1604 #ifdef ADCON__ADC_1__ADC_0__ADEX__ADCI__ADCS__AADR2__AADR1__AADR0
1605 #undef ADCON__ADC_1__ADC_0__ADEX__ADCI__ADCS__AADR2__AADR1__AADR0
1606 SFR(ADCON
, 0xC5); // A/D control, P80C552 specific
1607 // Not directly accessible Bits.
1614 #define ADC_0 0x40 // different name as ADC0 in P5
1615 #define ADC_1 0x80 // different name as ADC1 in P5
1620 SFR(ADDAT
, 0xD9); // A/D-converter data register SAB80515 specific
1625 SFR(ADDATH
, 0xD9); // A/D data high byte SAB80515A specific
1630 SFR(ADDATL
, 0xDA); // A/D data low byte SAB80515A specific
1635 SFR(ARCON
, 0xEF); // arithmetic control register SAB80517
1640 SFR(AP
, 0x9C); // DS80C390
1643 #ifdef AUXR__x__x__x__x__x__x__EXTRAM__A0
1644 #undef AUXR__x__x__x__x__x__x__EXTRAM__A0
1645 // P89C668 specific, Auxilary
1647 // not bit addressable:
1652 #ifdef AUXR__x__x__M0__x__XRS1__XRS0__EXTRAM__A0
1653 #undef AUXR__x__x__M0__x__XRS1__XRS0__EXTRAM__A0
1665 SBIT(BREG_F0
, 0xF0, 0);
1666 SBIT(BREG_F1
, 0xF0, 1);
1667 SBIT(BREG_F2
, 0xF0, 2);
1668 SBIT(BREG_F3
, 0xF0, 3);
1669 SBIT(BREG_F4
, 0xF0, 4);
1670 SBIT(BREG_F5
, 0xF0, 5);
1671 SBIT(BREG_F6
, 0xF0, 6);
1672 SBIT(BREG_F7
, 0xF0, 7);
1675 #ifdef AUXR1__x__x__x__x__GF3__x__x__DPS
1676 #undef AUXR1__x__x__x__x__GF3__x__x__DPS
1682 #ifdef AUXR1__x__x__ENBOOT__x__GF2__0__x__DPS
1683 #undef AUXR1__x__x__ENBOOT__x__GF2__0__x__DPS
1684 // P89C668 specific, Auxilary 1
1688 #define ALWAYS_ZERO 0x04
1695 // Not directly accessible bits
1706 SFR(C0C
, 0xA3); // DS80C390 specific
1707 // Not directly accessible bits
1720 SFR(C0IR
, 0xA5); // DS80C390 specific
1721 // Not directly accessible bits
1734 SFR(C0M1C
, 0xAB); // DS80C390 specific
1735 // Not directly accessible bits
1737 #define ROW_TIH 0x02
1748 SFR(C0M2C
, 0xAC); // DS80C390 specific
1753 SFR(C0M3C
, 0xAD); // DS80C390 specific
1758 SFR(C0M4C
, 0xAE); // DS80C390 specific
1763 SFR(C0M5C
, 0xAF); // DS80C390 specific
1768 SFR(C0M6C
, 0xB3); // DS80C390 specific
1773 SFR(C0M7C
, 0xB4); // DS80C390 specific
1778 SFR(C0M8C
, 0xB5); // DS80C390 specific
1783 SFR(C0M9C
, 0xB6); // DS80C390 specific
1788 SFR(C0M10C
, 0xB7); // DS80C390 specific
1793 SFR(C0M11C
, 0xBB); // DS80C390 specific
1798 SFR(C0M12C
, 0xBC); // DS80C390 specific
1803 SFR(C0M13C
, 0xBD); // DS80C390 specific
1808 SFR(C0M14C
, 0xBE); // DS80C390 specific
1813 SFR(C0M15C
, 0xBF); // DS80C390 specific
1818 SFR(C0RE
, 0xA7); // DS80C390 specific
1823 SFR(C0RMS0
, 0x96); // DS80C390 specific
1828 SFR(C0RMS1
, 0x97); // DS80C390 specific
1833 SFR(C0S
, 0xA4); // DS80C390 specific
1834 // Not directly accessible bits
1841 #define EC96_128 0x40
1847 SFR(C0TE
, 0xA6); // DS80C390 specific
1852 SFR(C0TMA0
, 0x9E); // DS80C390 specific
1857 SFR(C0TMA1
, 0x9F); // DS80C390 specific
1862 SFR(C1C
, 0xE3); // DS80C390 specific
1863 // Not directly accessible bits
1876 SFR(C1IR
, 0xE5); // DS80C390 specific
1877 // Not directly accessible bits
1890 SFR(C1RE
, 0xE7); // DS80C390 specific
1895 SFR(C1M1C
, 0xEB); // DS80C390 specific
1900 SFR(C1M2C
, 0xEC); // DS80C390 specific
1905 SFR(C1M3C
, 0xED); // DS80C390 specific
1910 SFR(C1M4C
, 0xEE); // DS80C390 specific
1915 SFR(C1M5C
, 0xEF); // DS80C390 specific
1920 SFR(C1M6C
, 0xF3); // DS80C390 specific
1925 SFR(C1M7C
, 0xF4); // DS80C390 specific
1930 SFR(C1M8C
, 0xF5); // DS80C390 specific
1935 SFR(C1M9C
, 0xF6); // DS80C390 specific
1940 SFR(C1M10C
, 0xF7); // DS80C390 specific
1945 SFR(C1M11C
, 0xFB); // DS80C390 specific
1950 SFR(C1M12C
, 0xFC); // DS80C390 specific
1955 SFR(C1M13C
, 0xFD); // DS80C390 specific
1960 SFR(C1M14C
, 0xFE); // DS80C390 specific
1965 SFR(C1M15C
, 0xFF); // DS80C390 specific
1970 SFR(C1S
, 0xE4); // DS80C390 specific
1971 // Not directly accessible bits
1984 SFR(C1TE
, 0xE6); // DS80C390 specific
1989 SFR(C1RSM0
, 0xD6); // DS80C390 specific
1994 SFR(C1RSM1
, 0xD7); // DS80C390 specific
1999 SFR(C1TMA0
, 0xDE); // DS80C390 specific
2004 SFR(C1TMA1
, 0xDF); // DS80C390 specific
2029 SFR(CC4EN
, 0xC9); // compare/capture 4 enable register SAB80517 specific
2032 #ifdef CCAP0H_AT_0XFA
2033 #undef CCAP0H_AT_0XFA
2037 #ifdef CCAP1H_AT_0XFB
2038 #undef CCAP1H_AT_0XFB
2042 #ifdef CCAP2H_AT_0XFC
2043 #undef CCAP2H_AT_0XFC
2047 #ifdef CCAP3H_AT_0XFD
2048 #undef CCAP3H_AT_0XFD
2052 #ifdef CCAP4H_AT_0XFE
2053 #undef CCAP4H_AT_0XFE
2057 #ifdef CCAP0L_AT_0XEA
2058 #undef CCAP0L_AT_0XEA
2062 #ifdef CCAP1L_AT_0XEB
2063 #undef CCAP1L_AT_0XEB
2067 #ifdef CCAP2L_AT_0XEC
2068 #undef CCAP2L_AT_0XEC
2072 #ifdef CCAP3L_AT_0XED
2073 #undef CCAP3L_AT_0XED
2077 #ifdef CCAP4L_AT_0XEE
2078 #undef CCAP4L_AT_0XEE
2082 #ifdef CCAPM0_AT_0XC2
2083 #undef CCAPM0_AT_0XC2
2084 // P89C668 specific, Capture module:
2088 #ifdef CCAPM0_AT_0XDA
2089 #undef CCAPM0_AT_0XDA
2100 #ifdef CCAPM1_AT_0XC3
2101 #undef CCAPM1_AT_0XC3
2105 #ifdef CCAPM1_AT_0XDB
2106 #undef CCAPM1_AT_0XDB
2110 #ifdef CCAPM2_AT_0XC4
2111 #undef CCAPM2_AT_0XC4
2115 #ifdef CCAPM2_AT_0XDC
2116 #undef CCAPM2_AT_0XDC
2120 #ifdef CCAPM3_AT_0XC5
2121 #undef CCAPM3_AT_0XC5
2125 #ifdef CCAPM3_AT_0XDD
2126 #undef CCAPM3_AT_0XDD
2130 #ifdef CCAPM4_AT_0XDE
2131 #undef CCAPM4_AT_0XDE
2135 #ifdef CCAPM4_AT_0XC6
2136 #undef CCAPM4_AT_0XC6
2142 SFR(CCEN
, 0xC1); // compare/capture enable register SAB80515 specific
2147 SFR(CCH1
, 0xC3); // compare/capture register 1, high byte SAB80515 specific
2152 SFR(CCH2
, 0xC5); // compare/capture register 2, high byte SAB80515 specific
2157 SFR(CCH3
, 0xC7); // compare/capture register 3, high byte SAB80515 specific
2162 SFR(CCH4
, 0xCF); // compare/capture register 4, high byte SAB80515 specific
2167 SFR(CCL1
, 0xC2); // compare/capture register 1, low byte SAB80515 specific
2172 SFR(CCL2
, 0xC4); // compare/capture register 2, low byte SAB80515 specific
2177 SFR(CCL3
, 0xC6); // compare/capture register 3, low byte SAB80515 specific
2182 SFR(CCL4
, 0xCE); // compare/capture register 4, low byte SAB80515 specific
2185 #ifdef CCON__0xD8__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
2186 #undef CCON__0xD8__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
2187 SFR(CCON
, 0xD8); // T89C51RD2 specific register
2189 SBIT(CCF0
, 0xD8, 0);
2190 SBIT(CCF1
, 0xD8, 1);
2191 SBIT(CCF2
, 0xD8, 2);
2192 SBIT(CCF3
, 0xD8, 3);
2193 SBIT(CCF4
, 0xD8, 4);
2198 #ifdef CCON__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
2199 #undef CCON__CF__CR__x__CCF4__CCF3__CCF2__CCF1__CCF0
2200 // P89C668 specific, PCA Counter control:
2203 SBIT(CCF0
, 0xC0, 0);
2204 SBIT(CCF1
, 0xC0, 1);
2205 SBIT(CCF2
, 0xC0, 2);
2206 SBIT(CCF3
, 0xC0, 3);
2207 SBIT(CCF4
, 0xC0, 4);
2208 //__sbit __at 0xC5 -
2223 #ifdef CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2224 #undef CMOD__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2225 // P89C668 specific, PCA Counter mode:
2227 // not bit addressable:
2235 #ifdef CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
2236 #undef CKCON__WD1__WD0__T2M__T1M__TOM__MD2__MD1__MD0
2237 SFR(CKCON
, 0x8E); // DS80C320 & DS80C390 specific
2238 // Not directly accessible Bits.
2249 #ifdef CKCON__X2__T0X2__T1X2__T2X2__SiX2__PcaX2__WdX2__x
2250 #undef CKCON__X2__T0X2__T1X2__T2X2__SiX2__PcaX2__WdX2__x
2263 SFR(CKMOD
, 0x96); // DS89C420 specific
2264 // Not directly accessible Bits.
2282 SFR(CMEN
, 0xF6); // compare enable register SAB80517 specific
2287 SFR(CMH0
, 0xD3); // compare register 0 high byte SAB80517 specific
2292 SFR(CMH1
, 0xD5); // compare register 1 high byte SAB80517 specific
2297 SFR(CMH2
, 0xD7); // compare register 2 high byte SAB80517 specific
2302 SFR(CMH3
, 0xE3); // compare register 3 high byte SAB80517 specific
2307 SFR(CMH4
, 0xE5); // compare register 4 high byte SAB80517 specific
2312 SFR(CMH5
, 0xE7); // compare register 5 high byte SAB80517 specific
2317 SFR(CMH6
, 0xF3); // compare register 6 high byte SAB80517 specific
2322 SFR(CMH7
, 0xF5); // compare register 7 high byte SAB80517 specific
2327 SFR(CMH0
, 0xC9); // Compare high 0, P80C552 specific
2332 SFR(CMH1
, 0xCA); // Compare high 1, P80C552 specific
2337 SFR(CMH2
, 0xCB); // Compare high 2, P80C552 specific
2342 SFR(CML0
, 0xD2); // compare register 0 low byte SAB80517 specific
2347 SFR(CML1
, 0xD4); // compare register 1 low byte SAB80517 specific
2352 SFR(CML2
, 0xD6); // compare register 2 low byte SAB80517 specific
2357 SFR(CML3
, 0xE2); // compare register 3 low byte SAB80517 specific
2362 SFR(CML4
, 0xE4); // compare register 4 low byte SAB80517 specific
2367 SFR(CML5
, 0xE6); // compare register 5 low byte SAB80517 specific
2372 SFR(CML6
, 0xF2); // compare register 6 low byte SAB80517 specific
2377 SFR(CML7
, 0xF4); // compare register 7 low byte SAB80517 specific
2382 SFR(CML0
, 0xA9); // Compare low 0, P80C552 specific
2387 SFR(CML1
, 0xAA); // Compare low 1, P80C552 specific
2392 SFR(CML2
, 0xAB); // Compare low 2, P80C552 specific
2395 #ifdef CMOD__0xD9__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2396 #undef CMOD__0xD9__CIDL__WDTE__x__x__x__CPS1__CPS0__ECF
2407 SFR(CMSEL
, 0xF7); // compare input select SAB80517
2432 SFR(COR
, 0xCE); // Dallas DS80C390 specific
2445 SFR(CRC
, 0xC1); // Dallas DS5001 specific
2456 SFR(CRCH
, 0xCB); // compare/reload/capture register, high byte SAB80515 specific
2461 SFR(CRCHIGH
, 0xC3); // DS5001 specific
2466 SFR(CRCL
, 0xCA); // compare/reload/capture register, low byte SAB80515 specific
2471 SFR(CRCLOW
, 0xC2); // DS5001 specific
2479 #ifdef CTCOM_AT_0XE1
2480 #undef CTCOM_AT_0XE1
2481 SFR(CTCON
, 0xE1); // com.timer control register SAB80517
2484 #ifdef CTCON__CTN3__CTP3__CTN2__CTP2__CTN1__CTP1__CTN0__CTP0
2485 #undef CTCON__CTN3__CTP3__CTN2__CTP2__CTN1__CTP1__CTN0__CTP0
2486 SFR(CTCON
, 0xEB); // Capture control, P80C552 specific
2487 // Not directly accessible Bits.
2500 SFR(CTH0
, 0xCC); // Capture high 0, P80C552 specific
2505 SFR(CTH1
, 0xCD); // Capture high 1, P80C552 specific
2510 SFR(CTH2
, 0xCE); // Capture high 2, P80C552 specific
2515 SFR(CTH3
, 0xCF); // Capture high 3, P80C552 specific
2520 SFR(CTL0
, 0xAC); // Capture low 0, P80C552 specific
2525 SFR(CTL1
, 0xAD); // Capture low 1, P80C552 specific
2530 SFR(CTL2
, 0xAE); // Capture low 2, P80C552 specific
2535 SFR(CTL3
, 0xAF); // Capture low 3, P80C552 specific
2540 SFR(CTRELH
, 0xDF); // com.timer rel register high byte SAB80517
2545 SFR(CTRELL
, 0xDE); // com.timer rel register low byte SAB80517
2548 #ifdef DAPR__SAB80515
2549 #undef DAPR__SAB80515
2550 SFR(DAPR
, 0xDA); // D/A-converter program register SAB80515 specific
2553 #ifdef DAPR__SAB80517
2554 #undef DAPR__SAB80517
2555 SFR(DAPR
, 0xDA); // D/A-converter program register SAB80517 specific
2561 SFR(DP0H
, 0x83); // Alternate name for AT89S53
2566 SFR(DPH1
, 0x85); // DS80C320 specific
2567 SFR(DP1H
, 0x85); // Alternate name for AT89S53
2572 SFR(DPL
, 0x82); // Alternate name for AT89S53
2578 SFR(DPL1
, 0x84); // DS80C320 specific
2579 SFR(DP1L
, 0x84); // Alternate name for AT89S53
2582 #ifdef DPS__x__x__x__x__x__x__x__SEL
2583 #undef DPS__x__x__x__x__x__x__x__SEL
2585 // Not directly accessible DPS Bit. DS80C320 & DPS8XC520 specific
2589 #ifdef DPS__ID1__ID0__TSL__x__x__x__x__SEL
2590 #undef DPS__ID1__ID0__TSL__x__x__x__x__SEL
2592 // Not directly accessible DPS Bit. DS89C390 specific
2599 #ifdef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
2600 #undef DPS__ID1__ID0__TSL__AID__x__x__x__SEL
2602 // Not directly accessible DPS Bit. DS89C420 specific
2612 SFR(DPSEL
, 0x92); // data pointer select register SAB80517
2617 SFR(DPX1
, 0x93); // DS80C390 specific
2622 SFR(DPX1
, 0x95); // DS80C390 specific
2647 #ifdef EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
2648 #undef EIE__x__x__x__EWDI__EX5__EX4__EX3__EX2
2650 // Bit registers DS80C320 specific
2655 SBIT(EWDI
, 0xE8, 4);
2658 #ifdef EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
2659 #undef EIE__CANBIE__C0IE__C1IE__EWDI__EX5__EX4__EX3__EX2
2661 // Bit registers DS80C390 specific
2666 SBIT(EWDI
, 0xE8, 4);
2667 SBIT(C1IE
, 0xE8, 5);
2668 SBIT(C0IE
, 0xE8, 6);
2669 SBIT(CANBIE
, 0xE8, 7);
2672 #ifdef EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
2673 #undef EIP__x__x__x__PWDI__PX5__PX4__PX3__PX2
2675 // Bit registers DS80C320 specific
2680 SBIT(PWDI
, 0xF8, 4);
2683 #ifdef EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
2684 #undef EIP__CANBIP__C0IP__C1IP__PWDI__PX5__PX4__PX3__PX2__PX1__PX0
2686 // Bit registers DS80C320 specific
2691 SBIT(PWDI
, 0xF8, 4);
2692 SBIT(C1IP
, 0xF8, 5);
2693 SBIT(C0IP
, 0xF8, 6);
2694 SBIT(CANBIP
, 0xF8, 7);
2697 #ifdef EIP0__x__x__x__LPWDI__LPX5__LPX4__LPX3__LPX2
2698 #undef EIP0__x__x__x__LPWDI__LPX5__LPX4__LPX3__LPX2
2700 // Bit registers DS89C420 specific
2701 SBIT(LPX2
, 0xF8, 0);
2702 SBIT(LPX3
, 0xF8, 1);
2703 SBIT(LPX4
, 0xF8, 2);
2704 SBIT(LPX5
, 0xF8, 3);
2705 SBIT(LPWDI
, 0xF8, 4);
2708 #ifdef EIP1__x__x__x__MPWDI__MPX5__MPX4__MPX3__MPX2
2709 #undef EIP1__x__x__x__MPWDI__MPX5__MPX4__MPX3__MPX2
2711 // Not directly accessible Bits DS89C420 specific
2722 // Not directly accessible Bits DS80C390 specific
2727 #ifdef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
2728 #undef EXIF__IE5__IE4__IE3__IE2__x__RGMD__RGSL__BGS
2730 // Not directly accessible EXIF Bits DS80C320 specific
2740 #ifdef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
2741 #undef EXIF__IE5__IE4__IE3__IE2__XT_RG__RGMD__RGSL__BGS
2743 // Not directly accessible EXIF Bits DS87C520 specific
2754 #ifdef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
2755 #undef EXIF__IE5__IE4__IE3__IE2__CKRY__RGMD__RGSL__BGS
2757 // Not directly accessible EXIF Bits DS80C390 & DS89C420 specific
2768 #ifdef FCNTL__FBUSY__FERR__x__x__FC3__FC2__FC1__FC0
2769 #undef FCNTL__FBUSY__FERR__x__x__FC3__FC2__FC1__FC0
2771 // Not directly accessible DS89C420 specific
2804 #ifdef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
2805 #undef IE__EA__x__x__ES__ET1__EX1__ET0__EX0
2816 #ifdef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
2817 #undef IE__EA__x__ET2__ES__ET1__EX1__ET0__EX0
2825 SBIT(ET2
, 0xA8, 5); // Enable timer2 interrupt
2829 #ifdef IE__EA__EAD__ES1__ES0__ET1__EX1__ET0__EX0
2830 #undef IE__EA__EAD__ES1__ES0__ET1__EX1__ET0__EX0
2831 SFR(IE
, 0xA8); // same as IEN0 - Interrupt enable 0, P80C552 specific
2832 SFR(IEN0
, 0xA8); // alternate name
2844 #ifdef IE__EA__EC__ET2__ES__ET1__EX1__ET0__EX0
2845 #undef IE__EA__EC__ET2__ES__ET1__EX1__ET0__EX0
2858 #ifdef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
2859 #undef IE__EA__ES1__ET2__ES__ET1__EX1__ET0__EX0
2867 SBIT(ES0
, 0xA8, 4); // Alternate name
2868 SBIT(ET2
, 0xA8, 5); // Enable timer2 interrupt
2873 #ifdef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
2874 #undef IE__EA_WDT_ET2_ES_ET1_EX1_ET0_EX0
2876 SFR(IEN0
, 0xA8); // Alternate name
2877 // Bit registers for the SAB80515 and compatible IE
2884 SBIT(ET2
, 0xA8, 5); // Enable timer 2 overflow SAB80515 specific
2885 SBIT(WDT
, 0xA8, 6); // watchdog timer reset - SAB80515 specific
2887 SBIT(EAL
, 0xA8, 7); // EA as called by Infineon / Siemens
2890 #ifdef IEN0__EA__EC__ES1__ES0__ET1__EX1__ET0__EX0
2891 #undef IEN0__EA__EC__ES1__ES0__ET1__EX1__ET0__EX0
2905 #ifdef IEN1__x__x__x__x__x__x__x__ET2
2906 #undef IEN1__x__x__x__x__x__x__x__ET2
2907 // P89C668 specific bit registers
2913 #ifdef IEN1__ET2__ECM2__ECM1__ECM0__ECT3__ECT2__ECT1__ECT0
2914 #undef IEN1__ET2__ECM2__ECM1__ECM0__ECT3__ECT2__ECT1__ECT0
2915 SFR(IEN1
, 0xE8); // Interrupt enable 1, P80C552 specific
2917 SBIT(ECT0
, 0xE8, 0);
2918 SBIT(ECT1
, 0xE8, 1);
2919 SBIT(ECT2
, 0xE8, 2);
2920 SBIT(ECT3
, 0xE8, 3);
2921 SBIT(ECM0
, 0xE8, 4);
2922 SBIT(ECM1
, 0xE8, 5);
2923 SBIT(ECM2
, 0xE8, 6);
2927 #ifdef IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
2928 #undef IEN1__EXEN2__SWDT__EX6__EX5__EX4__EX3__EX2__EADC
2929 SFR(IEN1
, 0xB8); // interrupt enable register - SAB80515 specific
2931 SBIT(EADC
, 0xB8, 0); // A/D converter interrupt enable
2937 SBIT(SWDT
, 0xB8, 6); // watchdog timer start/reset
2938 SBIT(EXEN2
, 0xB8, 7); // timer2 external reload interrupt enable
2941 #ifdef IEN2__SAB80517
2942 #undef IEN2__SAB80517
2943 SFR(IEN2
, 0x9A); // interrupt enable register 2 SAB80517
2951 #ifdef IP__x__x__x__PS__PT1__PX1__PT0__PX0
2952 #undef IP__x__x__x__PS__PT1__PX1__PT0__PX0
2962 #ifdef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
2963 #undef IP__x__x__PT2__PS__PT1__PX1__PT0__PX0
2971 SBIT(PS0
, 0xB8, 4); // alternate name
2975 #ifdef IP__x__PAD__PS1__PS0__PT1__PX1__PT0__PX0
2976 #undef IP__x__PAD__PS1__PS0__PT1__PX1__PT0__PX0
2977 SFR(IP
, 0xB8); // Interrupt priority 0, P80C552 specific
2978 SFR(IP0
, 0xB8); // alternate name
2989 #ifdef IP__x__PPC__PT2__PS__PT1__PX1__PT0__PX0
2990 #undef IP__x__PPC__PT2__PS__PT1__PX1__PT0__PX0
3002 #ifdef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
3003 #undef IP__x__PS1__PT2__PS__PT1_PX1__PT0__PX0
3015 #ifdef IP__PT2__PPC__PS1__PS0__PT1__PX1__PT0__PX0
3016 #undef IP__PT2__PPC__PS1__PS0__PT1__PX1__PT0__PX0
3017 // P89C668 specific:
3030 #ifdef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
3031 #undef IP__RWT__x__x__PS__PT1__PX1__PT0__PX0
3042 #ifdef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
3043 #undef IP0__x__WDTS__IP0_5__IP0_4__IP0_3__IP0_2__IP0_1__IP0_0
3044 SFR(IP0
, 0xA9); // interrupt priority register SAB80515 specific
3045 // Not directly accessible IP0 bits
3055 #ifdef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
3056 #undef IP0__x__LPS1__LPT2__LPS0__LPT1__LPX1__LPT0__LPX0
3057 SFR(IP0
, 0xB8); // interrupt priority register DS89C420 specific
3059 SBIT(LPX0
, 0xB8, 0);
3060 SBIT(LPT0
, 0xB8, 1);
3061 SBIT(LPX1
, 0xB8, 2);
3062 SBIT(LPT1
, 0xB8, 3);
3063 SBIT(LPS0
, 0xB8, 4);
3064 SBIT(LPT2
, 0xB8, 5);
3065 SBIT(LPS1
, 0xB8, 6);
3068 #ifdef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
3069 #undef IP1__x__x__IP1_5__IP1_4__IP1_3__IP1_2__IP1_1__IP1_0
3070 SFR(IP1
, 0xB9); // interrupt priority register SAB80515 specific
3071 // Not directly accessible IP1 bits
3080 #ifdef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
3081 #undef IP1__x__MPS1__MPT2__MPS0__MPT1__MPX1__MPT0__MPX0
3082 SFR(IP1
, 0xB1); // interrupt priority register DS89C420 specific
3083 // Not directly accessible IP1 bits
3093 #ifdef IP1__PT2__PCM2__PCM1__PCM0__PCT3__PCT2__PCT1__PCT0
3094 #undef IP1__PT2__PCM2__PCM1__PCM0__PCT3__PCT2__PCT1__PCT0
3095 SFR(IP1
, 0xF8); // Interrupt priority 1, P80C552 specific
3097 SBIT(PCT0
, 0xF8, 0);
3098 SBIT(PCT1
, 0xF8, 1);
3099 SBIT(PCT2
, 0xF8, 2);
3100 SBIT(PCT3
, 0xF8, 3);
3101 SBIT(PCM0
, 0xF8, 4);
3102 SBIT(PCM1
, 0xF8, 5);
3103 SBIT(PCM2
, 0xF8, 6);
3107 #ifdef IPH__x__PPCH__PT2H__PSH__PT1H__PX1H__PT0H__PX0H
3108 #undef IPH__x__PPCH__PT2H__PSH__PT1H__PX1H__PT0H__PX0H
3119 #ifdef IPH__PT2H__PPCH__PS1H__PS0H__PT1H__PX1H__PT0H__PX0H
3120 #undef IPH__PT2H__PPCH__PS1H__PS0H__PT1H__PX1H__PT0H__PX0H
3121 // P89C668 specific:
3123 // not bit addressable:
3136 SFR(IRCON
, 0xC0); // interrupt control register - SAB80515 specific
3138 SBIT(IADC
, 0xC0, 0); // A/D converter irq flag
3139 SBIT(IEX2
, 0xC0, 1); // external interrupt edge detect flag
3140 SBIT(IEX3
, 0xC0, 2);
3141 SBIT(IEX4
, 0xC0, 3);
3142 SBIT(IEX5
, 0xC0, 4);
3143 SBIT(IEX6
, 0xC0, 5);
3144 SBIT(TF2
, 0xC0, 6); // timer 2 owerflow flag
3145 SBIT(EXF2
, 0xC0, 7); // timer2 reload flag
3150 SFR(IRCON0
, 0xC0); // interrupt control register - SAB80515 specific
3152 SBIT(IADC
, 0xC0, 0); // A/D converter irq flag
3153 SBIT(IEX2
, 0xC0, 1); // external interrupt edge detect flag
3154 SBIT(IEX3
, 0xC0, 2);
3155 SBIT(IEX4
, 0xC0, 3);
3156 SBIT(IEX5
, 0xC0, 4);
3157 SBIT(IEX6
, 0xC0, 5);
3158 SBIT(TF2
, 0xC0, 6); // timer 2 owerflow flag
3159 SBIT(EXF2
, 0xC0, 7); // timer2 reload flag
3164 SFR(IRCON1
, 0xD1); // interrupt control register - SAB80515 specific
3174 SFR(MA
, 0xD3); // DS80C390
3179 SFR(MB
, 0xD4); // DS80C390
3184 SFR(MC
, 0xD5); // DS80C390
3189 SFR(MCNT0
, 0xD1); // DS80C390
3202 SFR(MCNT1
, 0xD2); // DS80C390
3208 #ifdef MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
3209 #undef MCON__IDM1__IDM0__CMA__x__PDCE3__PDCE2__PDCE1__PDCE0
3210 SFR(MCON
, 0xC6); // DS80C390
3220 #ifdef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
3221 #undef MCON__PA3__PA2__PA1__PA0__RA32_8__ECE2__PAA__SL
3222 SFR(MCON
, 0xC6); // DS5000
3233 #ifdef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
3234 #undef MCON__PA3__PA2__PA1__PA0__RG1__PES__PM__SL
3235 SFR(MCON
, 0xC6); // DS5001
3248 SFR(MD0
, 0xE9); // MUL / DIV register 0 SAB80517
3253 SFR(MD1
, 0xEA); // MUL / DIV register 1 SAB80517
3258 SFR(MD2
, 0xEB); // MUL / DIV register 2 SAB80517
3263 SFR(MD3
, 0xEC); // MUL / DIV register 3 SAB80517
3268 SFR(MD4
, 0xED); // MUL / DIV register 4 SAB80517
3273 SFR(MD5
, 0xEE); // MUL / DIV register 5 SAB80517
3278 SFR(MXAX
, 0xEA); // Dallas DS80C390
3285 SBIT(P0_0
, 0x80, 0);
3286 SBIT(P0_1
, 0x80, 1);
3287 SBIT(P0_2
, 0x80, 2);
3288 SBIT(P0_3
, 0x80, 3);
3289 SBIT(P0_4
, 0x80, 4);
3290 SBIT(P0_5
, 0x80, 5);
3291 SBIT(P0_6
, 0x80, 6);
3292 SBIT(P0_7
, 0x80, 7);
3295 #ifdef P0_EXT__AD7__AD6__AD5__AD4__AD3__AD2__AD1__AD0
3296 #undef P0_EXT__AD7__AD6__AD5__AD4__AD3__AD2__AD1__AD0
3297 // P89C668 alternate names for bits in P0
3312 SBIT(P1_0
, 0x90, 0);
3313 SBIT(P1_1
, 0x90, 1);
3314 SBIT(P1_2
, 0x90, 2);
3315 SBIT(P1_3
, 0x90, 3);
3316 SBIT(P1_4
, 0x90, 4);
3317 SBIT(P1_5
, 0x90, 5);
3318 SBIT(P1_6
, 0x90, 6);
3319 SBIT(P1_7
, 0x90, 7);
3322 #ifdef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
3323 #undef P1_EXT__INT5__INT4__INT3__INT2__TXD1__RXD1__T2EX__T2
3324 // P1 alternate functions
3326 SBIT(T2EX
, 0x90, 1);
3327 SBIT(RXD1
, 0x90, 2);
3328 SBIT(TXD1
, 0x90, 3);
3329 SBIT(INT2
, 0x90, 4);
3330 SBIT(INT3
, 0x90, 5);
3331 SBIT(INT4
, 0x90, 6);
3332 SBIT(INT5
, 0x90, 7);
3335 #ifdef P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
3336 #undef P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
3337 // P89C669 alternate names for bits __at P1
3338 // P1_EXT__SDA__SCL__CEX2__CEX1__CEX0__ECI__T2EX__T2
3340 SBIT(T2EX
, 0x90, 1);
3342 SBIT(CEX0
, 0x90, 3);
3343 SBIT(CEX1
, 0x90, 4);
3344 SBIT(CEX2
, 0x90, 5);
3349 #ifdef P1_EXT__T2__CLKOUT__T2EX__INT2__INT6_CC3__INT5_CC2__INT4_CC1__INT3_CC0
3350 SBIT(INT3_CC0
, 0x90, 0); // P1 alternate functions - SAB80515 specific
3351 SBIT(INT4_CC1
, 0x90, 1);
3352 SBIT(INT5_CC2
, 0x90, 2);
3353 SBIT(INT6_CC3
, 0x90, 3);
3354 SBIT(INT2
, 0x90, 4);
3355 SBIT(T2EX
, 0x90, 5);
3356 SBIT(CLKOUT
, 0x90, 6);
3360 #ifdef P1_EXT__CT0I__CT1I__CT2I__CT3I__T2__RT2__SCL__SDA
3361 #undef P1_EXT__CT0I__CT1I__CT2I__CT3I__T2__RT2__SCL__SDA
3363 SBIT(CT0I
, 0x90, 0); // Port 1 alternate functions, P80C552 specific
3364 SBIT(CT1I
, 0x90, 1);
3365 SBIT(CT2I
, 0x90, 2);
3366 SBIT(CT3I
, 0x90, 3);
3373 #ifdef P1_EXT__x__x__x__x__x__x__T2EX__T2
3374 #undef P1_EXT__x__x__x__x__x__x__T2EX__T2
3375 // P1 alternate functions
3377 SBIT(T2EX
, 0x90, 1);
3384 SBIT(P2_0
, 0xA0, 0);
3385 SBIT(P2_1
, 0xA0, 1);
3386 SBIT(P2_2
, 0xA0, 2);
3387 SBIT(P2_3
, 0xA0, 3);
3388 SBIT(P2_4
, 0xA0, 4);
3389 SBIT(P2_5
, 0xA0, 5);
3390 SBIT(P2_6
, 0xA0, 6);
3391 SBIT(P2_7
, 0xA0, 7);
3394 #ifdef P2_EXT__AD15__AD14__AD13__AD12__AD11__AD10__AD9__AD8
3395 #undef P2_EXT__AD15__AD14__AD13__AD12__AD11__AD10__AD9__AD8
3396 // P89C668 specific bit registers __at P2:
3399 SBIT(AD10
, 0xA0, 2);
3400 SBIT(AD11
, 0xA0, 3);
3401 SBIT(AD12
, 0xA0, 4);
3402 SBIT(AD13
, 0xA0, 5);
3403 SBIT(AD14
, 0xA0, 6);
3404 SBIT(AD15
, 0xA0, 7);
3411 SBIT(P3_0
, 0xB0, 0);
3412 SBIT(P3_1
, 0xB0, 1);
3413 SBIT(P3_2
, 0xB0, 2);
3414 SBIT(P3_3
, 0xB0, 3);
3415 SBIT(P3_4
, 0xB0, 4);
3416 SBIT(P3_5
, 0xB0, 5);
3417 #ifndef MCS51REG_EXTERNAL_RAM
3418 SBIT(P3_6
, 0xB0, 6);
3419 SBIT(P3_7
, 0xB0, 7);
3423 SBIT(RXD0
, 0xB0, 0);
3425 SBIT(TXD0
, 0xB0, 1);
3426 SBIT(INT0
, 0xB0, 2);
3427 SBIT(INT1
, 0xB0, 3);
3430 #ifndef MCS51REG_EXTERNAL_RAM
3436 #ifdef P3_EXT__x__x__CEX4__CEX3__x__x__x__x
3437 #undef P3_EXT__x__x__CEX4__CEX3__x__x__x__x
3438 // P89C668 specific bit registers __at P3 (alternate names)
3439 SBIT(CEX4
, 0xB0, 5);
3440 SBIT(CEX3
, 0xB0, 4);
3445 SFR(P4
, 0x80); // Port 4 - DS80C390
3447 SBIT(P4_0
, 0x80, 0);
3448 SBIT(P4_1
, 0x80, 1);
3449 SBIT(P4_2
, 0x80, 2);
3450 SBIT(P4_3
, 0x80, 3);
3451 SBIT(P4_4
, 0x80, 4);
3452 SBIT(P4_5
, 0x80, 5);
3453 SBIT(P4_6
, 0x80, 6);
3454 SBIT(P4_7
, 0x80, 7);
3457 #ifdef P4_AT_0XC0__CMT0__CMT1__CMSR5__CMSR4__CMSR3__CMSR2__CMSR1__CMSR0
3458 #undef P4_AT_0XC0__CMT0__CMT1__CMSR5__CMSR4__CMSR3__CMSR2__CMSR1__CMSR0
3459 SFR(P4
, 0xC0); // Port 4, P80C552 specific
3461 SBIT(CMSR0
, 0xC0, 0);
3462 SBIT(CMSR1
, 0xC0, 1);
3463 SBIT(CMSR2
, 0xC0, 2);
3464 SBIT(CMSR3
, 0xC0, 3);
3465 SBIT(CMSR4
, 0xC0, 4);
3466 SBIT(CMSR5
, 0xC0, 5);
3467 SBIT(CMT0
, 0xC0, 6);
3468 SBIT(CMT1
, 0xC0, 7);
3471 #ifdef P4_AT_0XC0__P4_7__P4_6__P4_5__P4_3__P4_2__P4_1__P4_0
3472 #undef P4_AT_0XC0__P4_7__P4_6__P4_5__P4_3__P4_2__P4_1__P4_0
3473 SFR(P4
, 0xC0); // Port 4, T89C51 specific
3475 SBIT(P4_0
, 0xC0, 0);
3476 SBIT(P4_1
, 0xC0, 1);
3477 SBIT(P4_2
, 0xC0, 2);
3478 SBIT(P4_3
, 0xC0, 3);
3479 SBIT(P4_4
, 0xC0, 4);
3480 SBIT(P4_5
, 0xC0, 5);
3481 SBIT(P4_6
, 0xC0, 6);
3482 SBIT(P4_7
, 0xC0, 7);
3487 SFR(P4
, 0xE8); // Port 4 - SAB80515 & compatible microcontrollers
3489 SBIT(P4_0
, 0xE8, 0);
3490 SBIT(P4_1
, 0xE8, 1);
3491 SBIT(P4_2
, 0xE8, 2);
3492 SBIT(P4_3
, 0xE8, 3);
3493 SBIT(P4_4
, 0xE8, 4);
3494 SBIT(P4_5
, 0xE8, 5);
3495 SBIT(P4_6
, 0xE8, 6);
3496 SBIT(P4_7
, 0xE8, 7);
3501 SFR(P4CNT
, 0x92); // DS80C390
3502 // Not directly accessible bits
3503 #define P4CNT_0 0x01
3504 #define P4CNT_1 0x02
3505 #define P4CNT_2 0x04
3506 #define P4CNT_3 0x08
3507 #define P4CNT_4 0x10
3508 #define P4CNT_5 0x20
3514 SFR(P5
, 0xA1); // Port 5 - DS80C390
3519 SFR(P5
, 0xE8); // Port 5 - T89C51RD2
3521 SBIT(P5_0
, 0xE8, 0);
3522 SBIT(P5_1
, 0xE8, 1);
3523 SBIT(P5_2
, 0xE8, 2);
3524 SBIT(P5_3
, 0xE8, 3);
3525 SBIT(P5_4
, 0xE8, 4);
3526 SBIT(P5_5
, 0xE8, 5);
3527 SBIT(P5_6
, 0xE8, 6);
3528 SBIT(P5_7
, 0xE8, 7);
3533 SFR(P5CNT
, 0xA2); // DS80C390
3534 // Not directly accessible bits
3535 #define P5CNT_0 0x01
3536 #define P5CNT_1 0x02
3537 #define P5CNT_2 0x04
3541 #define SBCAN0BA 0x40
3542 #define SBCAN1BA 0x80
3547 SFR(P5
, 0xC4); // Port 5, P80C552 specific
3548 // Not directly accessible Bits.
3561 SFR(P5
, 0xF8); // Port 5 - SAB80515 & compatible microcontrollers
3563 SBIT(P5_0
, 0xF8, 0);
3564 SBIT(P5_1
, 0xF8, 1);
3565 SBIT(P5_2
, 0xF8, 2);
3566 SBIT(P5_3
, 0xF8, 3);
3567 SBIT(P5_4
, 0xF8, 4);
3568 SBIT(P5_5
, 0xF8, 5);
3569 SBIT(P5_6
, 0xF8, 6);
3570 SBIT(P5_7
, 0xF8, 7);
3575 SFR(P6
, 0xDB); // Port 6 - SAB80515 & compatible microcontrollers
3580 SFR(P6
, 0xFA); // Port 6 - SAB80517 specific
3585 SFR(P7
, 0xDB); // Port 7 - SAB80517 specific
3590 SFR(P8
, 0xDD); // Port 6 - SAB80517 specific
3598 #ifdef PCON__SMOD__x__x__x__x__x__x__x
3599 #undef PCON__SMOD__x__x__x__x__x__x__x
3601 // Not directly accessible PCON bits
3605 #ifdef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
3606 #undef PCON__SMOD__x__x__x__GF1__GF0__PD__IDL
3608 // Not directly accessible PCON bits
3616 #ifdef PCON__SMOD__x__x__WLE__GF1__GF0__PD__IDL
3617 #undef PCON__SMOD__x__x__WLE__GF1__GF0__PD__IDL
3618 SFR(PCON
, 0x87); // PCON, P80C552 specific
3619 // Not directly accessible Bits.
3621 #define IDLE 0x01 /* same as IDL */
3629 #ifdef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
3630 #undef PCON__SMOD__PDS__IDLS__x__x__x__PD__IDL
3632 // Not directly accessible PCON bits
3634 #define IDLE 0x01 /* same as IDL */
3636 #define PDE 0x02 /* same as PD */
3641 #define PCON_IDLE 0x01
3642 #define PCON_PDE 0x02
3643 #define PCON_GF0 0x04
3644 #define PCON_GF1 0x08
3645 #define PCON_IDLS 0x20
3646 #define PCON_PDS 0x40
3647 #define PCON_SMOD 0x80
3650 #ifdef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
3651 #undef PCON__SMOD__POR__PFW__WTR__EPFW__EWT__STOP__IDL
3653 // Not directly accessible PCON bits
3655 #define IDLE 0x01 /* same as IDL */
3665 #ifdef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
3666 #undef PCON__SMOD__SMOD0__x__x__GF1__GF0__STOP__IDLE
3668 // Not directly accessible PCON bits
3670 #define IDLE 0x01 /* same as IDL */
3678 #ifdef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
3679 #undef PCON__SMOD__SMOD0__OFDF__OFDE__GF1__GF0__STOP__IDLE
3681 // Not directly accessible PCON bits
3683 #define IDLE 0x01 /* same as IDL */
3691 #define SMOD_0 0x80 /* same as SMOD */
3694 #ifdef PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
3695 #undef PCON__SMOD1__SMOD0__x__POF__GF1__GF0__PD__IDL
3706 #ifdef PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1__DME0
3707 #undef PMR__CD1__CD0__SWB__x__XTOFF__ALEOFF__DME1__DME0
3708 SFR(PMR
, 0xC4); // DS87C520, DS83C520
3709 // Not directly accessible bits
3719 #ifdef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
3720 #undef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEOFF__x__x
3721 SFR(PMR
, 0xC4); // DS80C390
3722 // Not directly accessible bits
3731 #ifdef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEON__DME1__DME0
3732 #undef PMR__CD1__CD0__SWB__CTM__4X_2X__ALEON__DME1__DME0
3733 SFR(PMR
, 0xC4); // DS89C420
3734 // Not directly accessible bits
3766 SFR(PWM0
, 0xFC); // PWM register 0, P80C552 specific
3771 SFR(PWM1
, 0xFD); // PWM register 1, P80C552 specific
3776 SFR(PWMP
, 0xFE); // PWM prescaler, P80C552 specific
3794 #ifdef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
3795 #undef ROMSIZE__x__x__x__x__x__RMS2__RMS1__RMS0
3796 SFR(ROMSIZE
, 0xC2); // DS87C520, DS83C520
3797 // Not directly accessible bits
3803 #ifdef ROMSIZE__x__x__x__x__PRAME__RMS2__RMS1__RMS0
3804 #undef ROMSIZE__x__x__x__x__PRAME__RMS2__RMS1__RMS0
3805 SFR(ROMSIZE
, 0xC2); // DS89C420
3806 // Not directly accessible bits
3813 #ifdef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
3814 #undef ROMSIZE__HBPF__BPF__TE__MOVCX__PRAME__RMS2__RMS1__RMS0
3815 SFR(ROMSIZE
, 0xC2); // DS87C520, DS83C520
3816 // Not directly accessible bits
3829 SFR(RPCTL
, 0xD8); // Dallas DS5001 specific
3832 SBIT(RPCON
, 0xD8, 1);
3836 SBIT(EXBS
, 0xD8, 5);
3837 SBIT(RNR_FLAG
, 0xD8, 7);
3840 #ifdef RTE__TP47__TP46__RP45__RP44__RP43__RP42__RP41__RP40
3841 #undef RTE__TP47__TP46__RP45__RP44__RP43__RP42__RP41__RP40
3842 SFR(RTE
, 0xEF); // Reset/toggle enable, P80C552 specific
3843 // Not directly accessible Bits.
3856 SFR(S0BUF
, 0x99); // serial channel 0 buffer register SAB80517 specific
3859 #ifdef S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
3860 #undef S0CON__SM0__SM1__SM2__REN__TB8__RB8__TI__RI
3861 SFR(S0CON
, 0x98); // serial channel 0 control register P80C552 specific
3863 // Already defined in SCON
3864 //SBIT(RI0, 0x98, 0);
3865 //SBIT(TI0, 0x98, 1);
3866 //SBIT(RB8, 0x98, 2);
3867 //SBIT(TB8, 0x98, 3);
3868 //SBIT(REN, 0x98, 4);
3869 //SBIT(SM2, 0x98, 5);
3870 //SBIT(SM1, 0x98, 6);
3871 //SBIT(SM0, 0x98, 7);
3874 #ifdef S0CON__SM0__SM1__SM20__REN0__TB80__RB80__TI0__RI0
3875 #undef S0CON__SM0__SM1__SM20__REN0__TB80__RB80__TI0__RI0
3876 // serial channel 0 buffer register SAB80517 specific(same as stock SCON)
3881 SBIT(RB80
, 0x98, 2);
3882 SBIT(TB80
, 0x98, 3);
3883 SBIT(REN0
, 0x98, 4);
3884 SBIT(SM20
, 0x98, 5);
3891 SFR(S0RELL
, 0xAA); // serial channel 0 reload register low byte SAB80517 specific
3896 SFR(S0RELH
, 0xBA); // serial channel 0 reload register high byte SAB80517 specific
3899 #ifdef S1ADR__x__x__x__x__x__x__x__GC
3900 #undef S1ADR__x__x__x__x__x__x__x__GC
3901 SFR(S1ADR
, 0xDB); // Serial 1 address, P80C552 specific
3902 // Not directly accessible Bits.
3908 SFR(S1BUF
, 0x9C); // serial channel 1 buffer register SAB80517 specific
3911 #ifdef S1CON_AT_0X9B
3912 #undef S1CON_AT_0X9B
3913 SFR(S1CON
, 0x9B); // serial channel 1 control register SAB80517 specific
3916 #ifdef S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
3917 #undef S1CON__CR2__ENS1__STA__ST0__SI__AA__CR1__CR0
3918 SFR(S1CON
, 0xD8); // Serial 1 control, P80C552 specific
3919 SFR(SICON
, 0xD8); // sometimes called SICON
3927 SBIT(ENS1
, 0xD8, 6);
3931 #ifdef S1DAT_AT_0XDA
3932 #undef S1DAT_AT_0XDA
3933 SFR(S1DAT
, 0xDA); // Serial 1 data, P80C552 specific
3934 SFR(SIDAT
, 0xDA); // sometimes called SIDAT
3937 #ifdef S1IST_AT_0XDC
3938 #undef S1IST_AT_0XDC
3945 SFR(S1RELL
, 0x9D); // serial channel 1 reload register low byte SAB80517 specific
3950 SFR(S1RELH
, 0xBB); // serial channel 1 reload register high byte SAB80517 specific
3953 #ifdef S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
3954 #undef S1STA__SC4__SC3__SC2__SC1__SC0__x__x__x
3955 SFR(S1STA
, 0xD9); // Serial 1 status, P80C552 specific
3956 // Not directly accessible Bits.
3971 // DS80C320 specific
3977 // DS80C320 specific
3981 #ifdef SADEN_AT_0XB9
3982 #undef SADEN_AT_0XB9
3988 // DS80C320 & DS80C390 specific
3994 // DS80C320 & DS80C390 specific
4006 // DS80C320 & DS80C390 specific
4028 SBIT(RI_0
, 0x98, 0);
4029 SBIT(TI_0
, 0x98, 1);
4030 SBIT(RB8_0
, 0x98, 2);
4031 SBIT(TB8_0
, 0x98, 3);
4032 SBIT(REN_0
, 0x98, 4);
4033 SBIT(SM2_0
, 0x98, 5);
4034 SBIT(SM1_0
, 0x98, 6);
4035 SBIT(SM0_0
, 0x98, 7);
4036 SBIT(FE_0
, 0x98, 7);
4037 SBIT(SM0_FE_0
, 0x98, 7);
4042 // DS80C320 - 80C390 specific
4045 SBIT(RI_1
, 0xC0, 0);
4046 SBIT(TI_1
, 0xC0, 1);
4047 SBIT(RB8_1
, 0xC0, 2);
4048 SBIT(TB8_1
, 0xC0, 3);
4049 SBIT(REN_1
, 0xC0, 4);
4050 SBIT(SM2_1
, 0xC0, 5);
4051 SBIT(SM1_1
, 0xC0, 6);
4052 SBIT(SM0_1
, 0xC0, 7);
4053 SBIT(FE_1
, 0xC0, 7);
4054 SBIT(SM0_FE_1
, 0xC0, 7);
4069 SFR(SPCR
, 0xD5); // AT89S53 specific
4070 // Not directly accesible bits
4083 SFR(SPDR
, 0x86); // AT89S53 specific
4084 // Not directly accesible bits
4097 SFR(SPSR
, 0xAA); // AT89S53 specific
4098 // Not directly accesible bits
4105 SFR(SRELH
, 0xBA); // Baudrate generator reload high
4110 SFR(SRELL
, 0xAA); // Baudrate generator reload low
4113 #ifdef STATUS__PIP__HIP__LIP__x__x__x__x__x
4114 #undef STATUS__PIP__HIP__LIP__x__x__x__x__x
4115 // DS80C320 specific
4117 // Not directly accessible Bits. DS80C320 specific
4123 #ifdef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
4124 #undef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
4125 SFR(STATUS
, 0xC5); // DS80C390 specific
4126 // Not directly accessible Bits.
4136 #ifdef STATUS__PIS2__PIS1__PIS0__x__SPTA1__SPRA1__SPTA0__SPRA0
4137 #undef STATUS__PIS2__PIS1__PIS0__x__SPTA1__SPRA1__SPTA0__SPRA0
4138 SFR(STATUS
, 0xC5); // DS89C420 specific
4139 // Not directly accessible Bits.
4149 #ifdef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
4150 #undef STATUS__PIP__HIP__LIP__x__SPTA1__SPRA1__SPTA0__SPRA0
4151 SFR(STATUS
, 0xC5); // DS80C390 specific
4152 // Not directly accessible Bits.
4162 #ifdef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
4163 #undef STATUS__PIP__HIP__LIP__XTUP__SPTA2__SPTA1__SPTA0__SPRA0
4164 SFR(STATUS
, 0xC5); // DS87C520 & DS83520specific
4165 // Not directly accessible Bits.
4176 #ifdef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
4177 #undef STATUS__ST7__ST6__ST5__ST4__IA0__F0__IBF__OBF
4178 SFR(STATUS
, 0xDA); // DS5001specific
4179 // Not directly accessible Bits.
4190 #ifdef STE__TG47__TG46__SP45__SP44__SP43__SP42__SP41__SP40
4191 #undef STE__TG47__TG46__SP45__SP44__SP43__SP42__SP41__SP40
4192 SFR(STE
, 0xEE); // Set enable, P80C552 specific
4193 // Not directly accessible Bits.
4206 SFR(SYSCON
, 0xB1); // XRAM Controller Access Control
4208 #define SYSCON_XMAP0 0x01
4209 #define SYSCON_XMAP1 0x02
4210 #define SYSCON_RMAP 0x10
4211 #define SYSCON_EALE 0x20
4224 #ifdef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
4225 #undef T2CON__TF2__EXF2__RCLK__TCLK__EXEN2__TR2__C_T2__CP_RL2
4227 // Definitions for the 8052 compatible microcontrollers.
4229 SBIT(CP_RL2
, 0xC8, 0);
4230 SBIT(C_T2
, 0xC8, 1);
4232 SBIT(EXEN2
, 0xC8, 3);
4233 SBIT(TCLK
, 0xC8, 4);
4234 SBIT(RCLK
, 0xC8, 5);
4235 SBIT(EXF2
, 0xC8, 6);
4238 SBIT(T2CON_0
, 0xC8, 0);
4239 SBIT(T2CON_1
, 0xC8, 1);
4240 SBIT(T2CON_2
, 0xC8, 2);
4241 SBIT(T2CON_3
, 0xC8, 3);
4242 SBIT(T2CON_4
, 0xC8, 4);
4243 SBIT(T2CON_5
, 0xC8, 5);
4244 SBIT(T2CON_6
, 0xC8, 6);
4245 SBIT(T2CON_7
, 0xC8, 7);
4248 #ifdef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
4249 #undef T2CON__T2PS__I3FR__I2FR__T2R1__T2R0__T2CM__T2I1__T2I0
4251 // Definitions for the Infineon / Siemens SAB80515, SAB80515A, SAB80517
4253 SBIT(T2I0
, 0xC8, 0);
4254 SBIT(T2I1
, 0xC8, 1);
4255 SBIT(T2CM
, 0xC8, 2);
4256 SBIT(T2R0
, 0xC8, 3);
4257 SBIT(T2R1
, 0xC8, 4);
4258 SBIT(I2FR
, 0xC8, 5);
4259 SBIT(I3FR
, 0xC8, 6);
4260 SBIT(T2PS
, 0xC8, 7);
4262 SBIT(T2CON_0
, 0xC8, 0);
4263 SBIT(T2CON_1
, 0xC8, 1);
4264 SBIT(T2CON_2
, 0xC8, 2);
4265 SBIT(T2CON_3
, 0xC8, 3);
4266 SBIT(T2CON_4
, 0xC8, 4);
4267 SBIT(T2CON_5
, 0xC8, 5);
4268 SBIT(T2CON_6
, 0xC8, 6);
4269 SBIT(T2CON_7
, 0xC8, 7);
4272 #ifdef T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
4273 #undef T2MOD__x__x__x__D13T1__D13T2__x__T2OE__DCEN
4274 // Definitions for the timer/counter 2 of the Atmel & Dallas microcontrollers
4276 // Not not directly accessible T2MOD bits
4283 #ifdef T2MOD__x__x__x__x__x__x__T2OE__DCEN
4284 #undef T2MOD__x__x__x__x__x__x__T2OE__DCEN
4285 // Definitions for the timer/counter 2 of the Atmel 89x52 microcontroller
4287 // Not not directly accessible T2MOD bits
4297 SFR(T3
, 0xFF); // Timer 3, P80C552 specific
4302 // DS500x, DS80C320 & DS80C390 specific
4353 // Not directly accessible TMOD bits
4357 #define T0_GATE 0x08
4361 #define T1_GATE 0x80
4363 #define T0_MASK 0x0F
4364 #define T1_MASK 0xF0
4367 #ifdef TM2CON__T2IS1__T2IS0__T2ER__T2B0__T2P1__T2P0__T2MS1__T2MS0
4368 #undef TM2CON__T2IS1__T2IS0__T2ER__T2B0__T2P1__T2P0__T2MS1__T2MS0
4369 SFR(TM2CON
, 0xEA); // Timer 2 control, P80C552 specific
4370 // Not directly accessible Bits.
4381 #ifdef TM2IR__T20V__CMI2__CMI1__CMI0__CTI3__CTI2__CTI1__CTI0
4382 #undef TM2IR__T20V__CMI2__CMI1__CMI0__CTI3__CTI2__CTI1__CTI0
4383 SFR(TM2IR
, 0xC8); // Timer 2 int flag reg, P80C552 specific
4385 SBIT(CTI0
, 0xC8, 0);
4386 SBIT(CTI1
, 0xC8, 1);
4387 SBIT(CTI2
, 0xC8, 2);
4388 SBIT(CTI3
, 0xC8, 3);
4389 SBIT(CMI0
, 0xC8, 4);
4390 SBIT(CMI1
, 0xC8, 5);
4391 SBIT(CMI2
, 0xC8, 6);
4392 SBIT(T20V
, 0xC8, 7);
4397 SFR(TMH2
, 0xED); // Timer high 2, P80C552 specific
4402 SFR(TML2
, 0xEC); // Timer low 2, P80C552 specific
4407 SFR(WCON
, 0x96); // AT89S53 specific
4408 // Not directly accesible bits
4419 // DS80C320 - 390, DS89C420, etc. specific
4424 SBIT(WTRF
, 0xD8, 2);
4425 SBIT(WDIF
, 0xD8, 3);
4427 SBIT(EPFI
, 0xD8, 5);
4429 SBIT(SMOD_1
, 0xD8, 7);
4432 #ifdef WDTPRG_AT_0XA7
4433 #undef WDTPRG_AT_0XA7
4435 #define WDTRPRG_S0 0x01
4436 #define WDTRPRG_S1 0x02
4437 #define WDTRPRG_S2 0x04
4442 SFR(WDTREL
, 0x86); // Watchdof Timer reload register
4445 #ifdef WDTRST_AT_0XA6
4446 #undef WDTRST_AT_0XA6
4452 SFR(XPAGE
, 0x91); // Page Address Register for Extended On-Chip Ram - Infineon / Siemens SAB80515A specific
4455 /////////////////////////
4456 /// Interrupt vectors ///
4457 /////////////////////////
4459 // Interrupt numbers: address = (number * 8) + 3
4460 #define IE0_VECTOR 0 // 0x03 external interrupt 0
4461 #define TF0_VECTOR 1 // 0x0b timer 0
4462 #define IE1_VECTOR 2 // 0x13 external interrupt 1
4463 #define TF1_VECTOR 3 // 0x1b timer 1
4464 #define SI0_VECTOR 4 // 0x23 serial port 0
4466 #ifdef MICROCONTROLLER_AT89S53
4467 #define TF2_VECTOR 5 /* 0x2B timer 2 */
4468 #define EX2_VECTOR 5 /* 0x2B external interrupt 2 */
4471 #ifdef MICROCONTROLLER_AT89X52
4472 #define TF2_VECTOR 5 /* 0x2B timer 2 */
4473 #define EX2_VECTOR 5 /* 0x2B external interrupt 2 */
4476 #ifdef MICROCONTROLLER_AT89X55
4477 #define TF2_VECTOR 5 /* 0x2B timer 2 */
4478 #define EX2_VECTOR 5 /* 0x2B external interrupt 2 */
4481 #ifdef MICROCONTROLLER_DS5000
4482 #define PFW_VECTOR 5 /* 0x2B */
4485 #ifdef MICROCONTROLLER_DS5001
4486 #define PFW_VECTOR 5 /* 0x2B */
4489 #ifdef MICROCONTROLLER_DS80C32X
4490 #define TF2_VECTOR 5 /* 0x2B */
4491 #define PFI_VECTOR 6 /* 0x33 */
4492 #define SIO1_VECTOR 7 /* 0x3B */
4493 #define IE2_VECTOR 8 /* 0x43 */
4494 #define IE3_VECTOR 9 /* 0x4B */
4495 #define IE4_VECTOR 10 /* 0x53 */
4496 #define IE5_VECTOR 11 /* 0x5B */
4497 #define WDI_VECTOR 12 /* 0x63 */
4500 #ifdef MICROCONTROLLER_DS89C420
4501 #define TF2_VECTOR 5 /* 0x2B */
4502 #define PFI_VECTOR 6 /* 0x33 */
4503 #define SIO1_VECTOR 7 /* 0x3B */
4504 #define IE2_VECTOR 8 /* 0x43 */
4505 #define IE3_VECTOR 9 /* 0x4B */
4506 #define IE4_VECTOR 10 /* 0x53 */
4507 #define IE5_VECTOR 11 /* 0x5B */
4508 #define WDI_VECTOR 12 /* 0x63 */
4511 #ifdef MICROCONTROLLER_DS8XC520
4512 #define TF2_VECTOR 5 /* 0x2B */
4513 #define PFI_VECTOR 6 /* 0x33 */
4514 #define SIO1_VECTOR 7 /* 0x3B */
4515 #define IE2_VECTOR 8 /* 0x43 */
4516 #define IE3_VECTOR 9 /* 0x4B */
4517 #define IE4_VECTOR 10 /* 0x53 */
4518 #define IE5_VECTOR 11 /* 0x5B */
4519 #define WDI_VECTOR 12 /* 0x63 */
4522 #ifdef MICROCONTROLLER_P80C552
4523 #define SIO1_VECTOR 5 // 0x2B SIO1 (I2C)
4524 #define CT0_VECTOR 6 // 0x33 T2 capture 0
4525 #define CT1_VECTOR 7 // 0x3B T2 capture 1
4526 #define CT2_VECTOR 8 // 0x43 T2 capture 2
4527 #define CT3_VECTOR 9 // 0x4B T2 capture 3
4528 #define ADC_VECTOR 10 // 0x53 ADC completion
4529 #define CM0_VECTOR 11 // 0x5B T2 compare 0
4530 #define CM1_VECTOR 12 // 0x63 T2 compare 1
4531 #define CM2_VECTOR 13 // 0x6B T2 compare 2
4532 #define TF2_VECTOR 14 // 0x73 T2 overflow
4535 #ifdef MICROCONTROLLER_P89C668
4536 #define SIO1_VECTOR 5 // 0x2b SIO1 (i2c)
4537 #define PCA_VECTOR 6 // 0x33 (Programmable Counter Array)
4538 #define TF2_VECTOR 7 // 0x3B (Timer 2)
4541 #ifdef MICROCONTROLLER_SAB80509
4542 #define RI0_VECTOR 4 // 0x23 serial port 0
4543 #define TI0_VECTOR 4 // 0x23 serial port 0
4544 #define TF2_VECTOR 5 // 0x2B timer 2
4545 #define EX2_VECTOR 5 // 0x2B external interrupt 2
4548 #define IADC_VECTOR 8 // 0x43 A/D converter interrupt
4549 #define IEX2_VECTOR 9 // 0x4B external interrupt 2
4550 #define IEX3_VECTOR 10 // 0x53 external interrupt 3
4551 #define IEX4_VECTOR 11 // 0x5B external interrupt 4
4552 #define IEX5_VECTOR 12 // 0x63 external interrupt 5
4553 #define IEX6_VECTOR 13 // 0x6B external interrupt 6
4556 #define SI1_VECTOR 16 // 0x83 serial port 1
4557 #define RI1_VECTOR 16 // 0x83 serial port 1
4558 #define TI1_VECTOR 16 // 0x83 serial port 1
4560 #define ICM_VECTOR 18 // 0x93 compare registers CM0-CM7
4561 #define CTF_VECTOR 19 // 0x9B compare time overflow
4562 #define ICS_VECTOR 20 // 0xA3 compare register COMSET
4563 #define ICR_VECTOR 21 // 0xAB compare register COMCLR
4564 #define ICC_VECTOR 26 // 0xD3 compare event interrupt ICC10-ICC17
4565 #define CT1_VECTOR 27 // 0xDB compare timer 1 oveflow
4568 #ifdef MICROCONTROLLER_SAB80515
4569 #define TF2_VECTOR 5 // 0x2B timer 2
4570 #define EX2_VECTOR 5 // 0x2B external interrupt 2
4571 #define IADC_VECTOR 8 // 0x43 A/D converter interrupt
4572 #define IEX2_VECTOR 9 // 0x4B external interrupt 2
4573 #define IEX3_VECTOR 10 // 0x53 external interrupt 3
4574 #define IEX4_VECTOR 11 // 0x5B external interrupt 4
4575 #define IEX5_VECTOR 12 // 0x63 external interrupt 5
4576 #define IEX6_VECTOR 13 // 0x6B external interrupt 6
4579 #ifdef MICROCONTROLLER_SAB80515A
4580 #define TF2_VECTOR 5 // 0x2B timer 2
4581 #define EX2_VECTOR 5 // 0x2B external interrupt 2
4582 #define IADC_VECTOR 8 // 0x43 A/D converter interrupt
4583 #define IEX2_VECTOR 9 // 0x4B external interrupt 2
4584 #define IEX3_VECTOR 10 // 0x53 external interrupt 3
4585 #define IEX4_VECTOR 11 // 0x5B external interrupt 4
4586 #define IEX5_VECTOR 12 // 0x63 external interrupt 5
4587 #define IEX6_VECTOR 13 // 0x6B external interrupt 6
4590 #ifdef MICROCONTROLLER_SAB80517
4591 #define TF2_VECTOR 5 // 0x2B timer 2
4592 #define EX2_VECTOR 5 // 0x2B external interrupt 2
4593 #define IADC_VECTOR 8 // 0x43 A/D converter interrupt
4594 #define IEX2_VECTOR 9 // 0x4B external interrupt 2
4595 #define IEX3_VECTOR 10 // 0x53 external interrupt 3
4596 #define IEX4_VECTOR 11 // 0x5B external interrupt 4
4597 #define IEX5_VECTOR 12 // 0x63 external interrupt 5
4598 #define IEX6_VECTOR 13 // 0x6B external interrupt 6
4601 #define SI1_VECTOR 16 // 0x83 serial port 1
4604 #define COMPARE_VECTOR 19 // 0x9B compare
4607 #ifdef MICROCONTORLLER_T89C51RD2
4608 #define TF2_VECTOR 5 /* 0x2B timer 2 */
4609 #define PCA_VECTOR 6 /* 0x33 Programmable Counter Array interrupt */
4610 #endif /* MICROCONTORLLER_T89C51RD2 */
4612 #endif // End of the header -> #ifndef MCS51REG_H