SH79F1611集成ADC和PWM的增强型8051微控制器1V1.01.特性基于8051指令流水线结构的8位单片机集成单周期执行时间16X16bit硬件乘法器集成8周期执行时间32/16bit硬件除法器集成1周期32bit硬件移位单元FlashROM:16K字节RAM:1.5K字节工作电压:fOSC=400k-27MHz,VDD=2.4V-5.5V高频振荡器(代码选项三选一):-陶瓷谐振器:400k-16MHz-晶体谐振器:400k-16MHz-内部RC高频振荡器:27MHz低频振荡器:内部RC低频振荡器:128KHz44个CMOS双向I/O管脚I/O内建上拉电阻P2口可增强灌电流能力(代码选项可选增强或标准)P0/P3口可增强拉电流能力(代码选项可选增强或标准)4个16位定时器/计数器T0/T1/T2/T3三个16位带死区控制PWM通道,6路输出,并且具有故障检测功能中断源:-定时器0/1/2/3-外部中断0-1-外部中断4:8输入-ADC-EUART,SPI-PWM周期和占空比中断-模拟比较器1/212+2通道12位1Msps高速模数转换器(ADC),自动触发ADC功能,16通道转换结果缓冲功能内建单输入模拟比较器CMP1内建多输入模拟施密特比较器CMP2内建2个模拟放大器OP1,OP2增强型UART一路8bit无死区PWM3输出蜂鸣音发生器SPI接口(主/从模式)内建的低电压复位功能(代码选项)-LVR电压1:4.1V-LVR电压2:2.8VCPU机器周期:-1振荡周期看门狗定时器(WDT)内建振荡器预热计数器低功耗工作模式:-空闲模式-掉电模式Flash型40位可读MCU识别码工作环境温度-40~+105℃封装:-TQFP482.概述SH79F1611是一种高速高效率8051兼容单片机。在同样振荡频率下,较之传统的8051芯片具有运行更快速,性能更优越的特性。SH79F1611保留了标准8051芯片的大部分特性,包括内置256字节RAM和2个16位定时器/计数器。此外,SH79F1611还集成了1280字节外部扩展RAM,以及存储程序的16K字节flash,此外还集成2K类EEPROM,用于在系统掉电后保存数据。SH79F1611还集成了两个多输入模拟比较器,两路放大器,12位集成数字比较功能的高速ADC,以及6输出带死区时间控制的电机控制PWM模块,非常适合于直流无刷电机/永磁同步电机控制。此外,SH79F1611集成了看门狗定时器,上电复位和低电压复位等功能,提供了2种低功耗省电模式。SH79F161123.方框图16KBytesFlashROMInternal256BytesExternal1280BytesDataRAMOscillatorPipelined8051architectureTimer0(16bit)Timer1(16bit)Timer2(16bit)Timer3(16bit)ResetcircuitRSTXTAL2XTAL1VDDExternalInterruptBUZZERPowerWatchDog16-bitPWMmodule3channel6outputInternalOscillatorPort2Configuration/IOPort1Configuration/IOP0.0-P0.7Port3Configuration/IO12-bitADCJtagports(fordebug)Port0Configuration/IOSPI2AnalogCOMPARATOR2OpAmplifierEUARTPort4Configuration/IOPort5Configuration/IO8bitPWMP1.0-P1.7P2.0-P2.7P3.0-P3.7P4.0-P4.7P5.0-P5.3SH79F161134.引脚配置48脚TQFP封装2523323130292827261234567891011331213141516171819222120444342414039383734SH79F1611U24353648474645OP2OUT/P1.7OP2N/P3.7NCXTAL1/INT44/P3.5P3.1/INT40/RXDOP2P/P3.6VDDP3.0/PWM3XTAL2/INT43/P3.4P2.6/T0/FLTP4.6/T3P4.5/T2EXC2P2/AN2/INT47/P0.4C2N/AN4/P0.6AN5/P0.7VREF/AN3/P0.5P5.0/MOSIP5.1/MISOP5.2/SCKTCK/RST/P1.5NCGNDAN10/P1.6P3.2/INT41/TXDP3.3/INT42P2.7/T1TDI/BUZ/P1.4P5.3/SSP4.7/T2P4.0/AN6P4.1/AN7OP1OUT/P0.0C1N/P0.1C1P/OP1P/P1.1TDO/AN8/INT0/P1.2OP1N/P1.0TMS/AN9/INT1/P1.3P2.0/PWM0P2.1/PWM1P2.2/PWM2P2.3/PWM01P2.4/PWM11P2.5/PWM21P4.2/AN11P4.4P4.3C2P1/AN1/INT46/P0.3C2P0/AN0/INT45/P0.2注意:引脚命名中,写在最外侧的引脚功能具有最高优先级,最内侧的引脚功能具有最低优先级(参见引脚配置图)。当一个引脚被高优先级的功能占用时,即使低优先级功能被允许,也不能作为低优先级功能的引脚。只有当软件禁止引脚的高优先级功能,相应引脚才能被释放作为低优先级端口使用。但也有同优先级情况,比如P0.2-P0.4,它们可以同时用作AD输入通道和比较器同相输入端,具体端口共用请参考7.6.4“端口共用”章节。SH79F16114引脚功能引脚编号引脚命名默认功能引脚编号引脚命名默认功能1TDI/BUZ/P1.4P1.425SS______/P5.3P5.32TCK/RST_________/P1.5RST_________26SCK/P5.2P5.23AN10/P1.6P1.627MISO/P5.1P5.14OP2OUT/P1.7P1.728MOSI/P5.0P5.05OP2N/P3.7P0.629T2/P4.7P4.76OP2P/P3.6P0.730T3/P4.6P4.67NC----31T2EX/P4.5P4.58VDD----32P4.4P4.49NC----33P4.3P4.310GND----34AN11/P4.2P4.211XTAL1/INT44/P3.5P3.535AN7/P4.1P4.112XTAL2/INT43/P3.4P3.436AN6/P4.0P4.013INT42/P3.3P3.337AN5/P0.7P0.714TXD/INT41/P3.2P3.238C2N/AN4/P0.6P0.615RXD/INT40/P3.1P3.139VREF/AN3/P0.5P0.516PWM3/P3.0P3.040C2P2/AN2/INT47/P0.4P0.417PWM0/P2.0P2.041C2P1/AN1/INT46/P0.3P0.318PWM1/P2.1P2.142C2P0/AN0/INT45/P0.2P0.219PWM2/P2.2P2.243C1N/P0.1P0.120PWM01/P2.3P2.344OP1OUT/P0.0P0.021PWM11/P2.4P2.445OP1N/P1.0P1.022PWM21/P2.5P2.546C1P/OP1P/P1.1P1.123P2.6/T0/FLTP2.647TDO/AN8/INT0/P1.2P1.224T1/P2.7P2.748TMS/AN9/INT1/P1.3P1.3SH79F161155.引脚描述引脚编号类型说明I/O端口P0.0-P0.7I/O8位双向I/O端口P1.0-P1.7I/O8位双向I/O端口P2.0-P2.7I/O8位双向I/O端口P3.0-P3.7I/O8位双向I/O端口P4.0-P4.7I/O8位双向I/O端口P5.0-P5.3I/O4位双向I/O端口定时器T0I/O定时器0外部输入/比较功能输出T1I/O定时器1外部输入/比较功能输出T2I/O定时器2外部输入/比较功能输出T2EXI定时器2重载/捕捉/方向控制T3I/O定时器3外部输入/比较功能输出PWMPWM01,11,21O16BITPWM互补输出PWM0,1,2O16BITPWM输出PWM3O8BITPWM独立输出FLTI16BITPWM模块故障输入信号模数转换器AN0-AN11IADC输入通道VREFIADC参考电压输入中断,复位,时钟,电源INT0,1I外部中断输入INT40-INT47I/O外部中断4输入源RST————I该引脚上保持10s以上的低电平,CPU将复位。由于有内建30kΩ上拉电阻连接到VDD,所以仅接一个外部电容即可实现上电复位。注意:在使用JTAG功能(仿真或工具烧写)时,外接电容不能大于0.01F,否则就应将外接电容断开。XTAL1I谐振器输入XTAL2O谐振器输出GNDP接地VDDP电源(2.4-5.5V)SH79F16116续上表EUARTRXDI/O串口数据输入TXDO串口数据输出蜂鸣器BUZO蜂鸣器输出SPIMOSII/OSPI主输入从输出引脚MISOI/OSPI主输入从输出引脚SCKI/OSPI串行时钟引脚SS———ISPI从设备选择引脚内部模拟比較器C1NI比较器1反相输入端(比较器1同相输入端和放大器1同相输入端OPP共用)C2NI比较器2反相输入端C2P0-2I比较器2同相多路输入端内部模拟放大器OP1PI放大器1同相输入端O1PNI放大器1反相输入端OP1OUTO放大器1输出端OP2PI放大器2同相输入端OP2NI放大器2反相输入端OP2OUTO放大器2输出端编程器接口TDOO调试接口:测试数据输出TMSI调试接口:测试模式选择TDII调试接口:测试数据输入TCKI调试接口:测试时钟输入注意:当P1.2-1.5作为调试接口时,P1.2-1.5的原有功能被禁止SH79F161176.SFR映像SH79F1611内置256字节的直接寻址寄存器,包括通用数据存储器和特殊功能寄存器(SFR),SH79F1611的SFR有以下几种:CPU内核寄存器:ACC,B,PSW,SP,DPL,DPHCPU内核增强寄存器:AUXC,DPL1,DPH1,INSCON,XPAGE电源时钟控制寄存器:PCON,SUSLOFlash寄存器:IB_OFFSET,IB_DATA,IB_CON1,IB_CON2,IB_CON3,IB_CON4,IB_CON5数据页面控制寄存器:XPAGE看门狗定时器寄存器:RSTSTAT系统时钟控制寄存器:CLKCON中断寄存器:IEN0,IEN1,IENC,IPH0,IPL0,IPH1,IPL1,EXF1I/O端口寄存器:P0,P1,P2,P3,P4,P5,P0CR,P1CR,P2CR,P3CR,P4CR,P5CR,P0PCR,P1PCR,P2PCR,P3PCR,P4PCR,P5PCR定时器寄存器:TCON,TMOD,TH0,TH1,TL0,TL1,T2CON,T2MOD,TH2,TL2,RCAP2L,RCAP2H,TCON1,T3CON,TL3,TH3EUART寄存器:SCON,SBUF,SADEN,SADDR,PCON,SBRTL,SBRTH,BFINEADC寄存器:ADCON1,ADCON2,ADT,SEQCON,ADCH1,ADCH2,SEQCHX,ADDXL,ADDXH,ADDGTL,ADDGTH,ADDLTL,ADDLTH,ADCMPCONSPI寄存器:DISPCON,DISPCON1,DISPCLK0,DISPCLK1,P0SS,P1SS,P2SS,P3SSPWM3寄存器:PWM3CON,PWM3P,PWM3DOP&CMP寄存器:CMP1CON,CMP2CON0,CM