79F162_32 UART2759.docx
《79F162_32 UART2759.docx》由会员分享,可在线阅读,更多相关《79F162_32 UART2759.docx(26页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、79F162/32 UART 驱动 例子双UART功能Uart0_TTxd-P3.1口Uart0_RRxd-P3.0 口Uart1_IIRTxd-P2.7口Uart1_IIRRxd-P2.6口两路UART,其其中Uartt1内部有红红外硬件载波波发生器,可可以从Uarrt1_IRRTxd直接接发射调制的的UART红外外载波信号79F32系统统寄存器#ifndeff_CPU332_H#definee_CPU332_HsfrACCC=0xE0;sfrB=0xF0;sfrCRRE=0xF1;/*C reggisterr*/sfrPSSW=0xD0;sfrSPP=0x81;sfrDPPL=0x82;s
2、frDPPH=0x83;sfrDPPL1=0x84;/*Data pointter2 LLow byyte*/sfrDPPH1=0x85;/*Data pointter2 HHigh bbyte*/sfrINNSCON=0x86;/*Data pointter seelect*/*bit0 - 0: DPTR*bit0 - 1: DPTR 1*bit2 - 0: 8 bitt modee = (A*B) = B(High Byte) (CA)*B= C(High Byte)16+ B(Miiddle Byte) (A/B) = A(Quotiient llow byyte) + B(Reema
3、ineer)*bit3 - 1: 16 biit modde= (CA/BB)= C(Quotiient HHigh BByte)8+ AA(Quottient Low BByte) + B(RRemainner)*/ sfrXPPAGE=0xF7;/*Memorry pagge*/sfrPCCON=0x87;/*powerr conttrol*/sfrSUUSLO=0x8E;/*suspeend moode coontroll*/sfrLPPDCON=0xB3;/*LPD ccontrool*/sfrIBB_CLK00=0xF9;/* fllash pprograammingg clocck
4、 reggisterr 0 */sfrIBB_CLK11=0xFA;/* flashh proggrammiing cllock rregistter 1 */sfrIBB_OFFSSET = 0xFB;/* Low bbyte ooffsett of fflash memorry forr proggrammiing */sfrIBB_DATAA= 0xFC;/* Data regisster ffor prrogrammming flashh memoory */sfrFOOCON=0xFD;/*flashh optiion coontroll*/sfrIBB_CON11=0xF2;/*F
5、lashh memoory coontroll regiister 1*/sfrIBB_CON22=0xF3;/*Flashh memoory coontroll regiister 2*/sfrIBB_CON33=0xF4;/*Flashh memoory coontroll regiister 3*/sfrIBB_CON44=0xF5;/*Flashh memoory coontroll regiister 4*/sfrIBB_CON55=0xF6;/*Flashh memoory coontroll regiister 5*/sfrWDDT=0xB1;/*watchhdog ttimer
6、 contrrol*/sfrSCCM=0xB2;/*systeem cllock sselectt and monittor*/sfrIEEN0=0xA8;/*Exterrnal iinterrrupt eenablee conttrol 11*/sfrIEEN1=0xA9;/*Exterrnal iinterrrupt eenablee conttrol 22*/sfrIPPL0=0xB8;/*Interrrupt priorrity ccontrool Loww 0*/sfrIPPH0=0xB4;/*Interrrupt priorrity ccontrool Higgh 0*/sfrIP
7、PL1=0xB9;/*Interrrupt priorrity ccontrool Loww 1*/sfrIPPH1=0xB5;/*Interrrupt priorrity ccontrool Higgh 1*/sfrP00=0x80;sfrP11=0x90;sfrP22=0xA0;sfrP33=0xB0;sfrP44=0xC0;sfrP00CR=0xE1;/*port 0 inpput/ouutput direcction contrrol*/sfrP11CR=0xE2;/*port 1 inpput/ouutput direcction contrrol*/sfrP22CR=0xE3;/*
8、port 2 inpput/ouutput direcction contrrol*/sfrP33CR=0xE4;/*port 3 inpput/ouutput direcction contrrol*/sfrP44CR=0xE5;sfrPPP0CR=0xE9;/*Interrnal ppull-hhigh eenablee for port00*/sfrPPP1CR=0xEA;/*Interrnal ppull-hhigh eenablee for port11*/sfrPPP2CR=0xEB;/*Interrnal ppull-hhigh eenablee for port22*/sfrP
9、PP3CR=0xEC;/*Interrnal ppull-hhigh eenablee for port33*/sfrPPP4CR=0xED;sfrTCCON=0x88;/*Timerr/Counnter 00 and 1 conntrol regisster*/sfrTMMOD=0x89;/*Timerr/Counnter 00 and 1 moddes*/sfrT00L=0x8A;/*Timerr/Counnter 00 low byte*/sfrT00H=0x8C;/*Timerr/Counnter 00 highh bytee*/sfrT11L=0x8B;/*Timerr/Counnt
10、er 11 low byte*/sfrT11H=0x8D;/*Timerr/Counnter 11 highh bytee*/sfrT22CON=0xC8;/*Timerr/Counnter 22 conttrol*/sfrT22MOD=0xC9;/*Timerr/Counnter 22 modee*/sfrRCCAP2L =0xCA;/*Timerr/Counnter 22 relooad/caapturee low byte*/sfrRCCAP2H =0xCB;/*Timerr/Counnter 22 relooad/caapturee highh bytee*/sfrT22L=0xCC;
11、sfrT22H=0xCD;sfrSCCON=0x98;/*seriaal conntrol*/sfrSBBUF=0x99;/*seriaal datta bufffer*/sfrSAADDR=0x9A;/*slavee addrress*/sfrSAADEN=0x9B;/*slavee addrress mmask*/sfrSCCON1=0xD8;/*seriaal 1 ccontrool*/sfrSBBUF1=0xD9;sfrSAADDR1=0xDA;sfrSAADEN1=0xDB;sfrIRRCON=0xA1;/*IR coontroll*/sfrSPPCON=0xF8;/*SPI cco
12、ntrool*/sfrSPPSTA=0xA2;/*SPI sstatuss*/sfrSPPDAT=0xA3;/*SPI ddata*/sfrI22CCON=0xA6;sfrI22CDAT=0xA7;sfrADDCON=0x93;/*ADC ccontrool*/sfrADDCT=0x94;/*ADC ttime sselectt*/sfrADDCH=0x95;/*ADC cconfigguratiion*/sfrADDDL=0x96;/*ADC ddata bbufferr low nibblle*/sfrADDDH=0x97;sfrLCCDCON=0xAB;/*LCD ccontrool*/
13、sfrLCCDCLK=0xAC;sfrP11SS=0xAD;/*P1 orr segmment sselectt*/sfrP00SS=0xAE;/*P0 orr segmment sselectt*/sfrPLLCON=0xAF;/*PWM LLCD coontroll*/sfrRTTCCON=0xBE;/*RTC ccontrool*/sfrRTTCDAT=0xBF;/*RTC ccalibrrationn dataa*/sfrSEECOND=0xC1;/*seconnd & hhalf ssecondd*/sfrMIINUTE=0xC2;sfrHOOUR=0xC3;sfrDAAY=0xC4
14、;sfrMOONTH=0xC5;sfrYEEAR=0xC6;sfrWEEEK=0xC7;sfrPWWMEN=0xCF;/*PWM ttimer enablle*/sfrPWWMLO=0xE7;/*PWM cclock*/sfrPWWMC=0xD2;sfrPWWMPL=0xD3;sfrPWWMPH=0xD4;sfrPWWMDL=0xD5;sfrPWWMDH=0xD6;sfrPWWMDT=0xD1;/*PWM ddead ttime ccontrool*/sfrEXXF0=0xE8;/*exterrnal iinterrrupt 22 conttrol*/*Bittaddreessablle */
15、sbitPP0_0=P00;sbitPP0_1=P01;sbitPP0_2=P02;sbitPP0_3=P03;sbitPP0_4=P04;sbitPP0_5=P05;sbitPP0_6=P06;sbitPP0_7=P07;sbitPP1_0=P10;sbitPP1_1=P11;sbitPP1_2=P12;sbitPP1_3=P13;sbitPP1_4=P14;sbitPP1_5=P15;sbitPP1_6=P16;sbitPP1_7=P17;sbitPP2_0=P20;sbitPP2_1=P21;sbitPP2_2=P22;sbitPP2_3=P23;sbitPP2_4=P24;sbitPP
16、2_5=P25;sbitPP2_6=P26;sbitPP2_7=P27;sbitPP3_0=P30;sbitPP3_1=P31;sbitPP3_2=P32;sbitPP3_3=P33;sbitPP3_4=P34;sbitPP3_5=P35;sbitPP3_6=P36;sbitPP3_7=P37;sbitPP4_0=P40;sbitPP4_1=P41;sbitPP4_2=P42;sbitPP4_3=P43;sbitPP4_4=P44;sbitPP4_5=P45;sbitPP4_6=P46;sbitPP4_7=P47;sbit CY = 0xD7;/* carryy bit */sbit AC =
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 79F162_32 UART2759 79 F162_32
限制150内