function of the registers.
Dallas DS89C420 definitions added by B. Torok / bela.torok@kssg.ch
+ Version 1.0.5 (Dec 15, 2000)
+ Definitions added: #ifdef MCS51REG_EXTERNAL_ROM
+ #ifdef MCS51REG_EXTERNAL_RAM
+ #ifdef MCS51REG_DISABLE_WARNINGS
+
+ Version 1.0.6 (Dec 15, 2000)
+ Correction, if External Memory (RAM or ROM) ist used P2 is used for the
+ upper 8 Adressbits instead of P3
+
Adding support for additional microcontrollers:
-----------------------------------------------
1. Don't modify this file!!!
2. Insert your code in a separate file e.g.: mcs51reg_update.h and include
- this after the #define HEADER_MCS51REG statement
+ this after the #define HEADER_MCS51REG statement in this file
3. The mcs51reg_update.h file should contain following definitions:
b. If necessary add entry(s) in for registers not defined in this file
- c. Define the tnterrupt vectors
+ c. Define interrupt vectors
4. Send me the file mcs51reg_update.h ( bela.torok@kssg.ch ).
I'm going to verify/merge new definitions to this file.
Use one of the following options:
- 1. use #include <mcs51reg.h> in your program & define REG_XXXXXX in your makefile.
+ 1. use #include <mcs51reg.h> in your program & define MICROCONTROLLER_XXXX in your makefile.
2. use following definitions prior the
#include <mcs51reg.h> line in your program:
MICROCONTROLLER_SAB80515A Infineon / Siemens SAB80515A
MICROCONTROLLER_SAB80517 Infineon / Siemens SAB80517
+ Additional definitions (use them prior the #include mcs51reg.h statement):
+
+ Ports P0 & P2 are not available for the programmer if external ROM used.
+ Use statement "#define MCS51REG_EXTERNAL_RAM" to undefine P0 & P2.
+
+ Ports P0, P2, P3_6, WR, P3_7 & RD are not available for the programmer if
+ external RAM is used.
+ Use statement "#define MCS51REG_EXTERNAL_RAM" to undefine P0, P2,
+ P3_6, WR, P3_7 & RD.
+
+ #define MCS51REG_DISABLE_WARNINGS -> disables warnings
+
-----------------------------------------------------------------------*/
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: 8051
+#endif
#define P0
#define SP
#define DPL
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: 8052
+#endif
// 8051 register set
#define P0
#define SP
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: Atmel AT89Cx051
+#endif
// 8051 register set without P0 & P2
#define SP
#define DPL
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: AT89S53
+#endif
// 8051 register set
#define P0
#define SP
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: AT89C52 or AT89LV52
+#endif
// 8051 register set
#define P0
#define SP
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: AT89C55 or AT89LV55
+#endif
// 8051 register set
#define P0
#define SP
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: Dallas DS80C320 or DS80C323
+#endif
// 8051 register set
#define P0
#define SP
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: Dallas DS89C420
+#endif
// 8051 register set
#define P0
#define SP
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: Dallas DS87C520 or DS85C520
+#endif
// 8051 register set
#define P0
#define SP
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: Infineon / Siemens SAB80515 & SAB80535
+#endif
// 8051 register set without IP
#define P0
#define SP
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: Infineon / Siemens SAB80515A
+#endif
// 8051 register set without IP
#define P0
#define SP
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
#endif
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning Selected HW: Infineon / Siemens SAB80517
+#endif
// 8051 register set without IP, SCON & SBUF
#define P0
#define SP
// use default if no microcontroller specified
#ifndef MICROCONTROLLER_DEFINED
#define MICROCONTROLLER_DEFINED
+#ifndef MCS51REG_DISABLE_WARNINGS
#warning //////////////////////////////////
#warning // No microcontroller defined! //
#warning //////////////////////////////////
#warning If you use a non supported
#warning microcontroller, mcs51reg.h can be
#warning easily extended to support your HW.
+#endif
// 8051 register set
#define P0
#define SP
// end of definitions for the default microcontroller
- #ifdef MCS51REG_ERROR
+#ifdef MCS51REG_ERROR
#error Two or more microcontrollers defined!
#endif
+#ifdef MCS51REG_EXTERNAL_ROM
+#ifndef MCS51REG_UNDEFINE_P0
+#define MCS51REG_UNDEFINE_P0
+#endif
+#ifndef MCS51REG_UNDEFINE_P2
+#define MCS51REG_UNDEFINE_P2
+#endif
+#endif
+
+#ifdef MCS51REG_EXTERNAL_RAM
+#ifndef MCS51REG_UNDEFINE_P0
+#define MCS51REG_UNDEFINE_P0
+#endif
+#ifndef MCS51REG_UNDEFINE_P2
+#define MCS51REG_UNDEFINE_P2
+#endif
+#endif
+
+#ifdef MCS51REG_UNDEFINE_P0
+#undef P0
+#endif
+
+#ifdef MCS51REG_UNDEFINE_P2
+#undef P2
+#endif
+
////////////////////////////////
/// Register definitions ///
/// (In alphabetical order) ///
sbit at 0xB3 P3_3 ;
sbit at 0xB4 P3_4 ;
sbit at 0xB5 P3_5 ;
+#ifndef MCS51REG_EXTERNAL_RAM
sbit at 0xB6 P3_6 ;
sbit at 0xB7 P3_7 ;
+#endif
// alternate names
sbit at 0xB0 RXD ;
sbit at 0xB1 TXD ;
sbit at 0xB3 INT1 ;
sbit at 0xB4 T0 ;
sbit at 0xB5 T1 ;
+#ifndef MCS51REG_EXTERNAL_RAM
sbit at 0xB6 WR ;
sbit at 0xB7 RD ;
#endif
+#endif
#ifdef P4_AT_0XE8
#undef P4_AT_0XE8
sfr at 0x87 PCON ;
// Not directly accessible PCON bits
#define IDL 0x01
-#define PD 0x02
+#define PD 0x02
#define GF0 0x04
#define GF1 0x08
#define SMOD 0x80