随着计算机技术尤其是单片微型机技术的发展,单片机被广泛应用在工业控制系统中单片机具有体积小、价格低廉、开发应用方便、可应用于恶劣工业环境的特点,在分布式控制系统中多采用单片机进行数据采集和现场控制。由于单片机的计算能力有限,难以进行复杂的数据处理,因此在功能复杂的控制系统中常采上位机下位机系统,单片机用作下位机进行数据采集和设备控制,而PC机用做上位机进行复杂的数据处理和对单片机的控制。因此如何实现PC机与单片机之间的通信具有重要的现实意义。论文详细介绍了单片机与PC机通信的软硬件实现。在硬件设计中,单片机系统与PC机系统通过RS-232串行通信端口进行互连,单片机系统将由PC机传输过来的数据信息动态的显示在LED数码管上。在软件设计中,采用VisualBasic6.0中的MSComm通信控件设计PC上的串口通信程序。关键词:单片机;串行通信;VB6.0;RS-232;LED数码管1DesignofaserialCommunicationsystembetweenMCUandpersonalcomputerAbstractAlongwiththedevelopmentofcomputer,especiallythetechnologyofMCU,MCUarewidelyusedinthesystemofindustrycontrol.Smallsize,lowprice,theconvenienceofdevelopmentandapplicationandhighadaptabilityareitspeculiarities,respectiviely.Itisusuallyusedindistributedsystemtocollectdataandcontrolonthescene.Owingtothelimitofcalculation,itisdifficulttoprocesscomplexdata.Therefore,PClowerlevelcomputersystemisoftenappliedinfunctionallycomplexsystem.MCUcollectsdataandcontrolequipmentsasDownsidemachine,whilePCmakescomplexdataprocessingandthecontrolofMCU.SOhowtorealizethecommunicationbetweenPCandMCUispracticallymeaningful.TheessayintroducesthecommunicationbetweenPCandMCUrealizedbysoftandhardwareindetails.INdesignofhardware,MCUisconnectedwithPCbytheserialportofRS-232anddisplaythedatapassedbyPContheLEDdynamically.Indesignofsoftware,programofserialportaredesignedbyMSCommcommunicationcontrolinthelanguageofVisualBasic6.0.KeyWords:MCU;SerialCommunication;VB6.0;RS-232;LED2目录1引言.....................................................................................................................................11.1单片机与PC机串行通信研究背景...............................................................................11.2单片机与PC机串行通信研究目的和意义...................................................................12串口通信基础.....................................................................................................................12.1两种常用接口方式..........................................................................................................22.1.1并行接口.......................................................................................................................22.1.2串行接口.......................................................................................................................22.2RS-232串行接口标准.....................................................................................................23系统总体设计.....................................................................................................................33.1系统指标设计..................................................................................................................33.1.1通信协议设定...............................................................................................................33.1.2系统实现描述...............................................................................................................33.2总体方案设计...............................