精心整理PSW:位号B7B6B5B4B3B2B1B0符号CYACF0RS1RS0OVF1P辅助寄存器AUXR(地址为8EH,复位值为01H):位号B7B6B5B4B3B2B1B0位名称T0x12T1x12UART_M0x6T2RT2_C/TT2x12EXTRAMS1ST2I/O口工作模式设置寄存器PnM1[7:0]PnM0[7:0]I/O口模式00准双向口(传统8051单片机I/O口模式)01推挽输出10仅为输入(高阻)11开漏(OpenDrain),内部上拉电阻断开,要外加上拉电阻辅助寄存器AUXR1(地址为A2H,复位值为00000000B)和外设功能切换寄存器P_SW2(地址为BAH,复位值为xxxxxxx0B)位号寄存器B7B6B5B4B3B2B1B0AUXR1S1_S1S1_S0CCP_S1CCP_S0SPI_S1SPI_S00DPSP_SW2PWM67_SPWM2345_SS4_SS3_SS2_SCLK_DIVSYSCKO_S1SYSCKO_S0ADRJTx_RxSYSCLKO_2CLKS2CLKS1CLKS0INT_CLKOEX4EX3EX2SYSCKO_S2T2CLKOT1CLKOT0CLKOTCON(地址为88H,复位值为00H)位号B7B6B5B4B3B2B1B0位名称TF1TR1TF0TR0IE1IT1IE0IT0SCON(地址为98H,复位值为00H)位号B7B6B5B4B3B2B1B0位名称SM0/FESM1SM2RENTB8RB8TIRIS2CON(地址为9AH,复位值为00H)位号B7B6B5B4B3B2B1B0位名称S2SM0-S2SM2S2RENS2TB8S2RB8S2TIS2RI串口3控制寄存器S3CON(地址为ACH,复位值为40H)位号B7B6B5B4B3B2B1B0位名称S3SM0S3ST3S3SM2S3RENS3TB8S3RB8S3TIS3RI串口4控制寄存器S4CON(地址为84H,复位值为00H)位号B7B6B5B4B3B2B1B0位名称S4SM0S4ST4S4SM2S4RENS4TB8S4RB8S4TIS4RI电源控制寄存器PCON(地址为87H,复位值为30H)位号B7B6B5B4B3B2B1B0位名称SMODSMOD0LVDFPOFGF1GF0PDIDLCCON(地址为D8H,复位值为00xxx000B)位号B7B6B5B4B3B2B1B0位名称CFCR---CCF2CCF1CCF0SPSTAT(地址为CDH,复位值为00xxxxxxB)位号B7B6B5B4B3B2B1B0位名称SPIFWCOL------ADC控制寄存器ADC_CONTR(地址为BCH,复位值为00H)位号B7B6B5B4B3B2B1B0位名称ADC_POWERSPEED1SPEED0ADC_FLAGADC_STARTCHS2CHS1CHS0中断允许寄存器IE(地址为A8H,复位值为00H)位号B7B6B5B4B3B2B1B0位名称EAELVDEADCESET1EX1ET0EX0中断允许寄存器IE2(地址为AFH,复位值为xxxxx000B)位号B7B6B5B4B3B2B1B0位名称-ET4ET3ES4ES3ET2ESPIES2外部中断使能和时钟输出寄存器INT_CLKO(地址为8FH,复位值为x000x000B)位号B7B6B5B4B3B2B1B0位名称-EX4EX3EX2MCKO_S2T2CLKOT1CLKOT0CLKO中断优先级寄存器IP(地址为B8H,复位值为00H)位号B7B6B5B4B3B2B1B0位名称PPCAPLVDPADCPSPT1PX1PT0PX0第二中断优先级寄存器IP2(地址为B5H,复位值为xxx00000B)位号B7B6B5B4B3B2B1B0位名称---PX4PPWMFDPPWMPSPIPS2TMOD(地址为89H,复位值为00H)位号B7B6B5B4B3B2B1B0定时器名定时器1定时器0位名称GATEC/TM1M0GATEC/TM1M0T4和T3控制寄存器T4T3M(地址为D1H,复位值为00H)位号B7B6B5B4B3B2B1B0位名称TR4T4_C/TT4x12T4CLKOTR3T3_C/TT3x12T3CLKOT0重装值寄存器高字节TH0(地址为8CH)、T0重装值寄存器低字节TL0(地址为8AH)、T1重装值寄存器高字节TH1(地址为8DH)、T1重装值寄存器低字节TL1(地址为8BH)、T2重装值寄存器高字节TH2(地址为D6H)、T2重装值寄存器低字节TL2(地址为D7H)、T3重装值寄存器高字节TH3(地址为D4H)、T3重装值寄存器低字节TL3(地址为D5H)、T4重装值寄存器高字节TH4(地址为D2H)、T4重装值寄存器低字节TL4(地址为D3H)时钟分频寄存器CLK_DIV(地址为97H,复位值为0000x000B)位号B7B6B5B4B3D2D1D0位名称MCKO_S1MCKO_S0ADRJTX_RX-CLKS2CLKS1CLKS0SPI控制寄存器SPCTL(地址为CEH,复位值为00000100B)位号B7B6B5B4B3B2B1B0位名称SSIGSPENDORDMSTRCPOLCPHASPR1SPR0SPI数据寄存器SPDAT(地址为CFH,复位值为00H)位号B7B6B5B4B3B2B1B0精心整理位名称MSBLSBP1ASF(地址为9DH,复位值为00H)位号B7B6B5B4B3B2B1B0位名称P17ASFP16ASFP15ASFP14ASFP13ASFP12ASFP11ASFP10ASFA/D转换结果寄存器ADC_RES(地址为BDH,复位值为00H)和ADC_RESL(地址为BEH,复位值为00H)IAP15W4K61S4单片机的中断源及其相关控制中断源中断入口地址默认中断优先级次序号优先级设置相关位低优先级高优先级中断请求标志位中断允许控制位外部中断INT00003H0(最高)PX001IE0EX0/EAT0溢出中断000BH1PT001TF0ET0/EA外部中断INT10013H2PX101IE1EX1/EAT1溢出中断001BH3PT101TF1ET1/EA串口1UART10023H4PS01RI+TIES/EAADC002BH5PADC01ADC_FLAGEADC/EALVD0033H6PLVD01LVDFELVD/EAPCA003BH7PPCA01CF+CCF0+CCF1(ECF+ECCF0+ECCF1)/EA串口2UART20043H8PS201S2RI+S2TIES2/EASPI004BH9PSPI01SPIFESPI/EA外部中断INT20053H100EX2/EA外部中断INT3005BH110EX3/EAT2溢出中断0063H120ET2/EA外部中断INT40083H160EX4/EA串口3中断008BH170ES3/EA串口4中断0093H180ES4/EAT3溢出中断009BH190ET3/EAT4溢出中断00A3H200ET4/EA比较器中断00ABH210(PIE+NIE)/EAPWM中断00B3H22PPWM01CBIF(EPWM+ECBI)/EAPWM异常检测中断00BBH23(最低)PPWMFD01FDIF(EPWM+EFD+EFDI)/EA常用波特率与系统时钟及重装时间常数之间的关系时钟频率/MHz分频模式波特率/bit/s时间常数高字节(THn)时间常数低字节(TLn)11.059212T19200FFHF4H9600FFHE8H4800FFHD0HOCM4X8C液晶显示模块基本命令集控制引脚控制命令功能RSR/WED7D6D5D4D3D2D1D000100000001消除显示0010000001*地址归位(复位到0x00)001000001I/DS进入点设定00100001DCB显示状态控制0010001S/CR/L**游标或显示移位控制001001DL*0RE**功能设定00101AC5AC4AC3AC2AC1AC0设置CGRAM地址0011AC6AC5AC4AC3AC2AC1AC0设置DDRAM地址011BFAC6AC5AC4AC3AC2AC1AC0读忙标志或地址101D7D6D5D4D3D2D1D0写数到内部RAM111D7D6D5D4D3D2D1D0从内部RAM读取数据表8-5OCM4X8C液晶显示模块扩充命令集控制引脚控制命令功能RSR/WED7D6D5D4D3D2D1D000100000001待命模式(DDRAM填满0x20,光标复位到0x00)0010000001SR卷动地址或IRAM地址选择图8-7OCM4X8C外形图精心整理001000001R1R2反白选择00100001SL**睡眠模式0010001*1REG0扩充功能设定00101AC5AC4AC3AC2AC1AC0设定IRAM地址或卷动地址0010AC6AC5AC4AC3AC2AC1AC0设定绘图RAM地址图8128x64液晶串行接口方式的时序图