当前位置:文档之家› 单片机特殊功能寄存器及相应功能

单片机特殊功能寄存器及相应功能

SPECIAL FUNCTION REGISTER ??Register (MSB) (LSB) ByteSymbol b7 b6 b5 b4 b3 b2 b1 b0 AddressP0 P0.7 P0.6 P0.5 P0.4 P0.3 P0.2 P0.1 P0.0 80H(128)SP 81H(129)DPL 82H(130)DPH 83H(131)PCON SMOD - - - GF1 GF0 PD IDL 87H(135)*PCON SMOD - - WLE GF1 GF0 PD IDL 87H(135)TCON TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 88H(136)TMOD GATE C/T M1 M0 GATE C/T M1 M0 89H(137)TL0 8AH(138)TL1 8BH(139)TH0 8CH(140)TH1 8DH(141)P1 P1.7 P1.6 P1.5 P1.4 P1.3 P1.2 T2EX T2 90H(144)*P1 SDA SCL RT2 T2 CT3I CT2I CT1I CT0I 90H(144)SCON SM0 SM1 SM2 REN TB8 RB8 TI RI 98H(152)SBUF 99H(153)P2 P2.7 P2.6 P2.5 P2.4 P2.3 P2.2 P2.1 P2.0 0A0H(208)IE EA - ET2 ES ET1 EX1 ET0 EX0 0A8H(168)*IEN0 EA EAD ES1 ES0 ET1 EX1 ET0 EX0 0A8H(168)+CML0 0A9H(169)+CML1 0AAH(170)+CML2 0ABH(171)+CTL0 0ACH(172)+CTL1 0ADH(173)+CTL2 0AEH(174)+CTL3 0AFH(175)P3 RD WR T1 T0 INT1 INT0 TXD RXD 0B0H(176)IP - - PT2 PS PT1 PX1 PT0 PX0 0B8H(184)*IP0 - PAD PS1 PS0 PT1 PX1 PT0 PX0 0B8H(184)+P4 CMT1 CMT0 CMSR5 CMSR4 CMSR3 CMSR2 CMSR1 CMSR0 0C0H(192)+P5 ADC7 ADC6 ADC5 ADC4 ADC3 ADC2 ADC1 ADC0 0C4H(196)+ADCON ADC.1 ADC.0 ADEX ADCI ADCS AADR2 AADR1 AADR0 0C5H(197)+ADCH 0C6H(198)T2CON TF2 EXF2 RCLK TCLK EXEN2 TR2 C/T2 CP/RL2 0C8H(200)*TM2IR T2OV CMI2 CMI1 CMI0 CTI3 CTI2 CTI1 CTI0 0C8H(200)+CMH0 0C9H(201)RCAP2L 0CAH(202)*CMH1 0CAH(202)RCAP2H 0CBH(203)*CMH2 0CBH(203)TL2 0CCH(204)*CTH0 0CCH(204)TH2 0CDH(205)*CTH1 0CDH(205)+CTH2 0CEH(206)+CTH3 0CFH(207)PSW CY AC F0 RS1 RS0 OV F1 P 0D0H(208)+S1CON ENS1 STA STO SI AA CR1 CR0 0D8H(216)+S1STA SC4 SC3 SC2 SC1 SC0 0 0 0 0D9H(217)+S1DAT 0DAH(218)+S1ADR SLAVE ADDRESSGC 0DBH(219)ACC ACC.7 ACC.6 ACC.5 ACC.4 ACC.3 ACC.2 ACC.1 ACC.0 0E0H(224)+IEN1 ET2 ECM2 ECM1 ECM0 ECT3 ECT2 ECT1 ECT0 0E8H(232)+TM2CON T2IS1 T2IS0 T2ER T2B0 T2P1 T2P0 T2MS1 T2MS0 0EAH(234) +CTCON CTN3 CTP3 CTN2 CTP2 CTN1 CTP1 CTN0 CTP0 0EBH(235) +TML2 0ECH(236)+TMH2 0EDH(237)+STE TG47 TG46 SP45 SP44 SP43 SP42 SP41 SP40 0EEH(238)+RTE TP47 TP46 RP45 RP44 RP43 RP42 RP41 RP40 0EFH(239)B B.7 B.6 B.5 B.4 B.3 B.2 B.1 B.0 0F0H(240)+IP1 PT2 PCM2 PCM1 PCM0 PCT3 PCT2 PCT1 PCT0 0F8H(248)+PWM0 0FCH(252)+PWM1 0FDH(253)+PWMP 0FEH(254)+T3 0FFH(255)Notes: 1. * denotes the difference between 80C552 and 80512. + denotes the addition of 80C552/*--------------------------------------------------------------------------W77C32.H - preliminary releaseHeader file for Winbond microcontroller W77C32Based on the Preliminary Release form March 1999Copyright (c) 1988-1999 Keil Elektronik GmbH and Keil Software, Inc. All rights reserved.--------------------------------------------------------------------------*//* BYTE Registers */sfr P0 = 0x80;sfr P1 = 0x90;sfr P2 = 0xA0;sfr P3 = 0xB0;sfr P4 = 0xA5;sfr PSW = 0xD0;sfr ACC = 0xE0;sfr B = 0xF0;sfr SP = 0x81;sfr DPL = 0x82;sfr DPH = 0x83;sfr PCON = 0x87;sfr TCON = 0x88;sfr TMOD = 0x89;sfr TL0 = 0x8A;sfr TL1 = 0x8B;sfr TH0 = 0x8C;sfr TH1 = 0x8D;sfr IE = 0xA8;sfr IP = 0xB8;sfr SCON = 0x98;sfr SBUF = 0x99;sfr T2CON = 0xC8;sfr T2MOD = 0xC9;sfr RCAP2L = 0xCA;sfr RCAP2H = 0xCB;sfr TL2 = 0xCC;sfr TH2 = 0xCD;/* W77C32 extensions */sfr DPS = 0x86;sfr CKCON = 0x8E;sfr EXIF = 0x91;sfr SADDR = 0xA9;sfr SADDR1 = 0xAA;sfr SADEN = 0xB9;sfr SADEN1 = 0xBA;sfr SCON1 = 0xC0;sfr SBUF1 = 0xC1;sfr ROMMAP = 0xC2;sfr PMR = 0xC4;sfr STATUS = 0xC5;sfr TA = 0xC7;sfr WDCON = 0xD8;sfr EIE = 0xE8;sfr EIP = 0xF8;/* BIT Registers */ /* P0 */sbit P0_7 = P0^7; sbit P0_6 = P1^6; sbit P0_5 = P0^5; sbit P0_4 = P1^4; sbit P0_3 = P0^3; sbit P0_2 = P1^2; sbit P0_1 = P0^1; sbit P0_0 = P1^0;/* TCON */sbit TF1 = TCON^7; sbit TR1 = TCON^6; sbit TF0 = TCON^5; sbit TR0 = TCON^4; sbit IE1 = TCON^3; sbit IT1 = TCON^2; sbit IE0 = TCON^1; sbit IT0 = TCON^0;/* P1 */sbit P1_7 = P1^7; sbit P1_6 = P1^6; sbit P1_5 = P1^5; sbit P1_4 = P1^4; sbit P1_3 = P1^3; sbit P1_2 = P1^2;sbit P1_0 = P1^0;/* SCON */sbit SM0 = SCON^7; sbit SM1 = SCON^6; sbit SM2 = SCON^5; sbit REN = SCON^4; sbit TB8 = SCON^3; sbit RB8 = SCON^2; sbit TI = SCON^1; sbit RI = SCON^0;/* P2 */sbit P2_7 = P2^7; sbit P2_6 = P2^6; sbit P2_5 = P2^5; sbit P2_4 = P2^4; sbit P2_3 = P2^3; sbit P2_2 = P2^2; sbit P2_1 = P2^1; sbit P2_0 = P2^0;/* IE */sbit EA = IE^7; sbit ES1 = IE^6; sbit ET2 = IE^5; sbit ES = IE^4; sbit ET1 = IE^3; sbit EX1 = IE^2; sbit ET0 = IE^1; sbit EX0 = IE^0;/* P3 */sbit RD = P3^7; sbit WR = P3^6; sbit T1 = P3^5; sbit T0 = P3^4; sbit INT1 = P3^3; sbit INT0 = P3^2; sbit TXD = P3^1; sbit RXD = P3^0;/* IP */sbit PT2 = IP^5;sbit PS = IP^4;sbit PT1 = IP^3;sbit PX1 = IP^2;sbit PT0 = IP^1;sbit PX0 = IP^0;/* SCON1 */sbit SM0_1 = SCON1^7; // alternative FE_1 sbit SM1_1 = SCON1^6;sbit SM2_1 = SCON1^5;sbit REN_1 = SCON1^4;sbit TB8_1 = SCON1^3;sbit RB8_1 = SCON1^2;sbit TI_1 = SCON1^1;sbit RI_1 = SCON1^0;/* T2CON */sbit TF2 = T2CON^7;sbit EXF2 = T2CON^6;sbit RCLK = T2CON^5;sbit TCLK = T2CON^4;sbit EXEN2 = T2CON^3;sbit TR2 = T2CON^2;sbit C_T2 = T2CON^1;sbit CP_RL2 = T2CON^0;/* PSW */sbit CY = PSW^7;sbit AC = PSW^6;sbit F0 = PSW^5;sbit RS1 = PSW^4;sbit RS0 = PSW^3;sbit OV = PSW^2;sbit F1 = PSW^1;sbit P = PSW^0;/* WDCON */sbit SMOD_1 = WDCON^7;sbit POR = WDCON^6;sbit WDIF = WDCON^4;sbit WTRF = WDCON^3;sbit EWT = WDCON^1;sbit RWT = WDCON^0;/* EIE */sbit EWDI = EIE^4;sbit EX5 = EIE^3;sbit EX4 = EIE^2;sbit EX3 = EIE^1;sbit EX2 = EIE^0;/* EIP */sbit PWDI = EIP^4;sbit PX5 = EIP^3;sbit PX4 = EIP^2;sbit PX3 = EIP^1;sbit PX2 = EIP^0;w77858或80c302的c51头文件w77858或80c302的c51头文件内有详细寄存器介绍/*--BYTE Registers-------------------------------------------------*/sfr P0 = 0x80;sfr P1 = 0x90;sfr P2 = 0xA0;sfr P3 = 0xB0;#define p0 P0#define p1 P1#define p2 P2#define p3 P3sfr PSW = 0xD0;sfr ACC = 0xE0;sfr B = 0xF0;sfr SP = 0x81;sfr DPL = 0x82;sfr DPH = 0x83;sfr PCON = 0x87;//PCON.7(SMOD)拨特率加倍,PCON.1(PD)掉电方式,PCON.0(IDL)冻结方式//PCON.6(SMOD0)帧错检测允许,PCON.3(GF1)PCON.2(GF0)sfr TCON = 0x88;//定时控制寄存器sfr TMOD = 0x89;//"gate,c/t,m1,m0"x2定时器方式GATE=1时只有intx=1时才可以开放定时器x;//c/t =1时计书数方式,=0时定时方式。

相关主题