UARTXmodemV1.1-Dec8,200519,InnovationFirstRoadScienceParkHsin-ChuTaiwan300R.O.C.Tel:886-3-578-6005Fax:886-3-578-4418E-mail:mcu@sunplus.com.cn专业单片机、计算机资料网诺德单片机学习资料UARTXmodemSunplusTechnologyCo.,Ltd.PAGE2V1.1–Dec.8,2005it502.com/study专业单片机、计算机资料网诺德单片机学习资料UARTXmodemSunplusTechnologyCo.,Ltd.PAGE3V1.1–Dec.8,20051.............................................................................................................................................51.1............................................................................................................................51.2Xmodem.......................................................................................................................51.3Xmodem.......................................................................................................................51.3.1............................................................................................................51.3.2............................................................................................................51.3.3.....................................................................................................61.3.4CRC...................................................................................................71.4............................................................................................................................92...........................................................................................................................................102.1..........................................................................................................................102.2..........................................................................................................................102.3.......................................................................................................................103...........................................................................................................................................133.1DEMO.........................................................................................................................133.2..........................................................................................................................154MCU...................................................................................................................................194.1MCU....................................................................................................195...........................................................................................................................................26it502.com/study专业单片机、计算机资料网诺德单片机学习资料UARTXmodemSunplusTechnologyCo.,Ltd.PAGE4V1.1–Dec.8,20051.02004/01/131.12005/12/08it502.com/study专业单片机、计算机资料网诺德单片机学习资料UARTXmodemSunplusTechnologyCo.,Ltd.PAGE5V1.1–Dec.8,200511.1SPMC75F2413AUARTUploadPC-SPMC75F2413A,Xmodem1.2XmodemFTPFileTransferProtocolXmodemYmodemZmodemKERMITXmodem128CRC10Xmodem1.3Xmodem1.3.11SOH01HEOT04HACK06HNAK15HCAN18H2UARTAsynchronous8databitsnoparityonestopbit1.3.2XmodemWardChritensen70SOH128128ACKNAKXmodem11StartOfHearderPacketNumber~(PacketNumber)PacketDataCheckSumByte1Byte2Byte3Byte4--131Byte13211it502.com/study专业单片机、计算机资料网诺德单片机学习资料UARTXmodemSunplusTechnologyCo.,Ltd.PAGE6V1.1–Dec.8,2005Xmodem90SOH128CRC16StartOfHearderPacketNumber~(PacketNumber)PacketData16-BitCRCByte1Byte2Byte3Byte4--131Byte132--1331.3.31SOHblk#255-blk#--128databytes--cksumSOH=01hexblk#=011FFhex255-blk#=cksum=2NAK11511SenderFlowReceiver---NAKTimeoutafter3Second---NAKSOH0x010xFEData[0-127]Chksum---PacketOK---ACKSOH0x020xFDData[0-127]Chksum---Linehitduringtransmission---NAKSOH0x020xFDData[0-127]Chksum---PacketOK---ACKSOH0x030xFCData[0-127]Chksum---PacketOKACKgetgarbaged---ACKSOH0x030xFCData[0-127]Chksum---Duplicatepacket---NAKSOH0x040xFBData[0-127]Chksum---UARTFramingerronanybyte---NAKSOH0x040xFBData[0-127]Chksum---PacketOK---ACKSOH0x050xFAData[0-127]Chksum---UARTOverrunerronanybyteit502.com/study专业单片机、计算机资料网诺德单片机学习资料UARTXmodemSunplusTechnologyCo.,Ltd.PAGE7V1.1–Dec.8,2005SenderFlowReceiver---NAKSOH0x050xFAData[0-127]Chksum---PacketOK---ACKEOT---PacketOKACKgetgarbaged---ACKEOT---PacketOKFinished---ACK1.3.4CRC1CRCSOHblk#255-blk#--128databytes--CRChiCRCloSOH=01hexblk#=011FFhex255-blk#=CRChi=CRC16CRClo=CRC162CRC16BitCRCX^16+X^12+X^5+1128CRCCRC163CRCCRCC12312CRCSenderFlowReceiver---‘C’Timeoutafter3Second---‘C’SOH0x010xFEData[0-127]CRC16---PacketOK---ACKSOH0x020xFDData[0-127]CRC16---Linehitduringtransmission---NAKSOH0x020xFDData[0-127]CRC16---PacketOK---ACKSOH0x030xFCData[0-127]CRC16---PacketOK---ACKEOT---PacketOKACKgetgarbaged---ACKEOT---PacketOKit502.com/study专业单片机、计算机资料网诺德单片机学习资料UARTXmodemSunplusTechnologyCo.,Ltd.PAGE8V1.1–Dec.8,2005SenderFlowReceiverFinished---ACK4NAK