;-------------------------------------------------------------------------------
; P89LPC952 Processor Declarations
;
; WRITED BY WangJiading 2007.6.10
;-------------------------------------------------------------------------------
$SAVE
$NOLIST
;/* Include memory mapped SFRs */
;/* Analog Digital Converter 0*/
ADC0HBND DATA 0xFFEF ;ADC0高_边界寄存器,左(MSB)
ADC0LBND DATA 0xFFEE ;ADC0低_边界寄存器(MSB)
AD0DAT0R DATA 0xFFFE ;ADC0数据寄存器0,右(MSB)
AD0DAT0L DATA 0xFFFF ;ADC0数据寄存器0,左(MSB)
AD0DAT1R DATA 0xFFFC ;ADC0数据寄存器1,右(MSB)
AD0DAT1L DATA 0xFFFD ;ADC0数据寄存器1,左(MSB)
AD0DAT2R DATA 0xFFFA ;ADC0数据寄存器2,右(MSB)
AD0DAT2L DATA 0xFFFB ;ADC0数据寄存器2,左(MSB)
AD0DAT3R DATA 0xFFF8 ;ADC0数据寄存器3,右(MSB)
AD0DAT3L DATA 0xFFF9 ;ADC0数据寄存器3,左(MSB)
AD0DAT4R DATA 0xFFF6 ;ADC0数据寄存器4,右(MSB)
AD0DAT4L DATA 0xFFF7 ;ADC0数据寄存器4,左(MSB)
AD0DAT5R DATA 0xFFF4 ;ADC0数据寄存器5,右(MSB)
AD0DAT5L DATA 0xFFF5 ;ADC0数据寄存器5,左(MSB)
AD0DAT6R DATA 0xFFF2 ;ADC0数据寄存器6,右(MSB)
AD0DAT6L DATA 0xFFF3 ;ADC0数据寄存器6,左(MSB)
AD0DAT7R DATA 0xFFF0 ;ADC0数据寄存器7,右(MSB)
AD0DAT7L DATA 0xFFF1 ;ADC0数据寄存器7,左(MSB)
BNDSTA0 DATA 0xFFED ;ADC0边界状态寄存器
BRGCON_1 DATA 0xFFB3 ;波特率发生器1控制寄存器
BRG0_1 DATA 0xFFB4 ;波特率发生器1低字节
BRG1_1 DATA 0xFFB5 ;波特率发生器1高字节
;/* Port 4/5 Configuration */
P4M1 DATA 0xFFB8 ;P4输出模式1
P4M2 DATA 0xFFB9 ;P4输出模式2
P5M1 DATA 0xFFBA ;P5输出模式1
P5M2 DATA 0xFFBB ;P5输出模式2
;/* Serial 1 Configuration */
S1ADDR DATA 0xFFB2 ;串口1地址寄存器
S1ADEN DATA 0xFFB1 ;串口1地址使能寄存器
S1BUF DATA 0xFFB0 ;串口1数据缓冲器寄存器
;/* BYTE Registers */
P0 DATA 0x80;
P1 DATA 0x90;
P2 DATA 0xA0;
P3 DATA 0xB0;
P4 DATA 0xB3;
P5 DATA 0xB4;
PSW DATA 0xD0;
ACC DATA 0xE0;
B DATA 0xF0;
SP DATA 0x81;
DPL DATA 0x82;
DPH DATA 0x83;
PCON DATA 0x87;
TCON DATA 0x88;
TMOD DATA 0x89;
TL0 DATA 0x8A;
TL1 DATA 0x8B;
TH0 DATA 0x8C;
TH1 DATA 0x8D;
IEN0 DATA 0xA8;
IP0 DATA 0xB8;
S0CON DATA 0x98;
S0BUF DATA 0x99;
AD0CON DATA 0x97;
AD0INS DATA 0xA3;
AD0MODA DATA 0xC0;
AD0MODB DATA 0xA1;
AUXR1 DATA 0xA2;
S0ADDR DATA 0xA9;
S0ADEN DATA 0xB9;
BRGR0_0 DATA 0xBE;
BRGR1_0 DATA 0xBF;
BRGCON_0 DATA 0xBD;
CMP1 DATA 0xAC;
CMP2 DATA 0xAD;
DIVM DATA 0x95;
FMADRH DATA 0xE7;
FMADRL DATA 0xE6;
FMCON DATA 0xE4;
FMDATA DATA 0xE5;
I2ADR DATA 0xDB;
I2CON DATA 0xD8;
I2DAT DATA 0xDA;
I2SCLH DATA 0xDD;
I2SCLL DATA 0xDC;
I2STAT DATA 0xD9;
IEN1 DATA 0xE8;
IEN2 DATA 0xD5;
IP1 DATA 0xF8;
IP1H DATA 0xF7;
IP2 DATA 0xD6;
IP2H DATA 0xD7;
KBCON DATA 0x94;
KBMASK DATA 0x86;
KBPATN DATA 0x93;
P0M1 DATA 0x84;
P0M2 DATA 0x85;
P1M1 DATA 0x91;
P1M2 DATA 0x92;
P2M1 DATA 0xA4;
P2M2 DATA 0xA5;
P3M1 DATA 0xB1;
P3M2 DATA 0xB2;
PCONA DATA 0xB5;
PT0AD DATA 0xF6;
RSTSRC DATA 0xDF;
RTCCON DATA 0xD1;
RTCH DATA 0xD2;
RTCL DATA 0xD3;
S0STAT DATA 0xBA;
SPCTL DATA 0xE2;
SPSTAT DATA 0xE1;
SPDAT DATA 0xE3;
S1CON DATA 0xB6;
S1STAT DATA 0xD4;
TAMOD DATA 0x8F;
TRIM DATA 0x96;
WDCON DATA 0xA7;
WDL DATA 0xC1;
WFEED1 DATA 0xC2;
WFEED2 DATA 0xC3;
IP0H DATA 0xB7;
;/* BIT Registers */
;/* PSW */
CY BIT PSW.7;
AC BIT PSW.6;
F0 BIT PSW.5;
RS1 BIT PSW.4;
RS0 BIT PSW.3;
OV BIT PSW.2;
F1 BIT PSW.1;
P BIT PSW.0;
;/* TCON */
TF1 BIT TCON.7;
TR1 BIT TCON.6;
TF0 BIT TCON.5;
TR0 BIT TCON.4;
IE1 BIT TCON.3;
IT1 BIT TCON.2;
IE0 BIT TCON.1;
IT0 BIT TCON.0;
;/* IEN0 */
EA BIT IEN0.7;
EWDRT BIT IEN0.6;
EBO BIT IEN0.5;
ES BIT IEN0.4; // alternatively "ESR"
ESR BIT IEN0.4;
ET1 BIT IEN0.3;
EX1 BIT IEN0.2;
ET0 BIT IEN0.1;
EX0 BIT IEN0.0;
;/* IEN1 */
EAD BIT IEN1.7; // alternatively "EIEE"
EIEE BIT IEN1.7;
EST BIT IEN1.6;
ECCU BIT IEN1.4;
ESPI BIT IEN1.3;
EC BIT IEN1.2;
EKBI BIT IEN1.1;
EI2C BIT IEN1.0;
;/* IP0 */
PWDRT BIT IP0.6;
PB0 BIT IP0.5;
PS BIT IP0.4; // alternatively "PSR"
PSR BIT IP0.4;
PT1 BIT IP0.3;
PX1 BIT IP0.2;
PT0 BIT IP0.1;
PX0 BIT IP0.0;
;/* IP1 */
PAD BIT IP1.7; // alternatively "PIEE"
PIEE BIT IP1.7;
PST BIT IP1.6;
PCCU BIT IP1.4;
PSPI BIT IP1.3;
PC_ BIT IP1.2;
PKBI BIT IP1.1;
PI2C BIT IP1.0;
;/* S0CON */串口0控制寄存器,地址:98H
SM0_0 BIT S0CON.7;该位的用途由PCON寄存器中的SMOD0决定 // alternatively "FE"
FE_0 BIT S0CON.7;alternatively "FE"
SM1_0 BIT S0CON.6;和SM0_0定义串行口操作模式
SM2_0 BIT S0CON.5;使能模式2和3中的多机通信功能
REN_0 BIT S0CON.4;使能串行接受
TB8_0 BIT S0CON.3;模式2和3中将要发送的第9位数据
RB8_0 BIT S0CON.2;模式2和3中,该位为接受到的第9位数据
TI_0 BIT S0CON.1;发送中断标志0
RI_0 BIT S0CON.0;接收中断标志0
;/* S1CON各位屏蔽字 */串口1控制寄存器,地址:0B6H
SM0_1_MSK DATA 0x80; // alternatively "FE"
FE_1_MSK DATA 0x80
SM1_1_MSK DATA 0x40
SM2_1_MSK DATA 0x20
REN_1_MSK DATA 0x10
TB8_1_MSK DATA 0x08
RB8_1_MSK DATA 0x04
TI_1_MSK DATA 0x02
RI_1_MSK DATA 0x01
;/* I2CON */I2C控制寄存器,地址:0D8H
I2EN BIT I2CON.6;I2C接口使能
STA BIT I2CON.5;起始标志
STO BIT I2CON.4;停止标志
SI BIT I2CON.3;I2C中断标志
AA BIT I2CON.2;发送应答标志
CRSEL BIT I2CON.0;SCL时钟选择
;/* P0 */
KB7 BIT P0.7; // alternatively "T1"
T1 BIT P0.7;
KB6 BIT P0.6; // alternatively "CMP1";CMP1 DATA P0.6;
KB5 BIT P0.5;
KB4 BIT P0.4;
KB3 BIT P0.3;
KB2 BIT P0.2;
KB1 BIT P0.1;
KB0 BIT P0.0; // alternatively "CMP2"//CMP2 DATA P0.0;
;/* P1 */
OCC BIT P1.7;
OCB BIT P1.6;
RST BIT P1.5;
INT1 BIT P1.4;
;INT0 BIT P1.3; // alternatively "SDA"
;SDA BIT P1.3;
;T0 BIT P1.2; // alternatively "SCL"
;SCL BIT P1.2;
RxD BIT P1.1;
TxD BIT P1.0;
;/* P2 */
ICA BIT P2.7;
OCA BIT P2.6;
SPICLK BIT P2.5;
SS BIT P2.4;
MISO BIT P2.3;
MOSI BIT P2.2;
OCD BIT P2.1;
ICB BIT P2.0;
;/* P3 */
XTAL1 BIT P3.1;
XTAL2 BIT P3.0;
;/* ADMODA */
BNDI0 BIT AD0MODA.7;
BURST0 BIT AD0MODA.6;
SCC0 BIT AD0MODA.5;
SCAN0 BIT AD0MODA.4;