Header file for the Atmel AT89S52.
Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
All rights reserved.
--------------------------------------------------------------------------*/
Note: Only Registers located on addresses that
are evenly divisible by 8 are bit addressable.
All other registers use bit masks.
------------------------------------------------*/
sfr P0 = 0x80; /* Port 0 */
sfr SP = 0x81; /* Stack Pointer */
sfr DPL = 0x82; /* Data Pointer Low Byte */
sfr DP0L = 0x82; /* Alternate Definition */
sfr DPH = 0x83; /* Data Pointer High Byte */
sfr DP0H = 0x83; /* Alternate Definition */
sfr DP1L = 0x84; /* Data Pointer 1 Low Byte */
sfr DP1H = 0x85; /* Data Pointer 1 High Byte */
sfr PCON = 0x87; /* Power Control Register */
sfr TCON = 0x88; /* Timer Control Register */
sfr TMOD = 0x89; /* Timer Mode Control Register */
sfr TL0 = 0x8A; /* Timer 0 Low Byte */
sfr TL1 = 0x8B; /* Timer 1 Low Byte */
sfr TH0 = 0x8C; /* Timer 0 High Byte */
sfr TH1 = 0x8D; /* Timer 1 High Byte */
sfr AUXR = 0x8E; /* Auxiliary Register*/
sfr P1 = 0x90; /* Port 1 */
sfr SCON = 0x98; /* Serial Port Control */
sfr SBUF = 0x99; /* Serial Port Buffer */
/*------------------------------------------------
SCON (0x98) Bit Registers
------------------------------------------------*/
sbit RI = 0x98; /* Receive Interrupt Flag */
sbit TI = 0x99; /* Transmit Interrupt Flag */
sbit RB8 = 0x9A; /* 9th data bit received */
sbit TB8 = 0x9B; /* 9th data bit to be transmitted in modes 2 & 3 */
sbit REN = 0x9C; /* Receive Enable */
sbit SM2 = 0x9D; /* Serial Port Mode Bit 2 */
sbit SM1 = 0x9E; /* Serial Port Mode Bit 1 */
sbit SM0 = 0x9F; /* Serial Port Mode Bit 0 */
/*------------------------------------------------
T2MOD (0xC9) Bit Values
------------------------------------------------*/
#define DCEN_ 0x01 /* 1=Timer 2 can be configured as up/down counter */
#define T2OE_ 0x02 /* Timer 2 output enable */
/*------------------------------------------------
PSW (0xD0) Bit Registers
------------------------------------------------*/
sbit P = 0xD0; /* Parity Flag */
sbit FL = 0xD1; /* User Flag */
sbit OV = 0xD2; /* Overflow Flag */
sbit RS0 = 0xD3; /* Register Bank Select Bit 0 */
sbit RS1 = 0xD4; /* Register Bank Select Bit 1 */
sbit F0 = 0xD5; /* User Flag 0 */
sbit AC = 0xD6; /* Auxiliary Carry Flag */
sbit CY = 0xD7; /* Carry Flag */