您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 单片机与PC机串行通信系统设计
撰写日期:2011年5月17日河南农业大学本科生毕业论文(设计)题目单片机与PC机串行通信系统设计学院机电工程学院专业班级电子信息工程07级3班学生姓名王卫亮、高岚指导教师胡建东1摘要随着计算机技术尤其是单片微型机技术的发展,单片机被广泛应用在工业控制系统中。单片机具有体积小、价格低廉、开发应用方便、可应用于恶劣工业环境的特点,在分布式控制系统中多采用单片机进行数据采集和现场控制。由于单片机的计算能力有限,难以进行复杂的数据处理,因此在功能复杂的控制系统中常采上位机下位机系统,单片机用作下位机进行数据采集和设备控制,而PC机用做上位机进行复杂的数据处理和对单片机的控制。因此如何实现PC机与单片机之间的通信具有重要的现实意义。论文详细介绍了单片机与PC机通信的软硬件实现。在硬件设计中,单片机系统与PC机系统通过RS-232串行通信端口进行互连,单片机系统将由PC机传输过来的数据信息动态的显示在LED数码管上。在软件设计中,采用VisualBasic6.0中的MSComm通信控件设计PC上的串口通信程序,在单片机编程上采用接近硬件系统的汇编语言编写通信程序及数据处理程序。关键词:单片机;串行通信;VB6.0;RS-485;LED数码管2DesignofaserialCommunicationsystembetweenMCUandpersonalcomputerAbstractAlongwiththedevelopmentofcomputer,especiallythetechnologyofMCU,MCUarewidelyusedinthesystemofindustrycontrol.Smallsize,lowprice,theconvenienceofdevelopmentandapplicationandhighadaptabilityareitspeculiarities,respectiviely.Itisusuallyusedindistributedsystemtocollectdataandcontrolonthescene.Owingtothelimitofcalculation,itisdifficulttoprocesscomplexdata.Therefore,PClowerlevelcomputersystemisoftenappliedinfunctionallycomplexsystem.MCUcollectsdataandcontrolequipmentsasDownsidemachine,whilePCmakescomplexdataprocessingandthecontrolofMCU.SOhowtorealizethecommunicationbetweenPCandMCUispracticallymeaningful.TheessayintroducesthecommunicationbetweenPCandMCUrealizedbysoftandhardwareindetails.INdesignofhardware,MCUisconnectedwithPCbytheserialportofRS-232anddisplaythedatapassedbyPContheLEDdynamically.Indesignofsoftware,programofserialportaredesignedbyMSCommcommunicationcontrolinthelanguageofVisualBasic6.0,ontheotherhand,theprogramofcommunicationanddataprocessingareprogrammedbythelanguageofassembly,whichismoreclosetothehardsystemusedbytheMCU.KeyWords:MCU;SerialCommunication;VB6.0;RS-485;LED3目录1引言...................................................................................................................................11.1单片机与PC机串行通信研究背景.............................................................................11.2单片机与PC机串行通信研究目的和意义.................................................................11.3论文研究内容................................................................................................................12串口通信基础理论...........................................................................................................22.1两种常用接口方式........................................................................................................22.1.1并行接口.....................................................................................................................22.1.2串行接口.....................................................................................................................22.2RS-232串行接口标准....................................................................................................22.3MSComm控件...............................................................................................................32.3.1MSComm控件处理通信的方式................................................................................32.3.2MSComm控件的主要属性........................................................................................43系统总体设计...................................................................................................................53.1系统指标设计................................................................................................................53.1.1通信协议设?...............................................................................................................53.1.2系统功能设计.............................................................................................................53.2总体方案设计................................................................................................................54硬件jiekoudianlu设计.....................................................................................................64.1主要芯片........................................................................................................................64.1.1AT89C51简介..............................................................................................................64.1.2单电源转换芯片MAX232.........................................................................................84.1.374LS245LED驱动芯片...............................................................................................84.2LED显示器....................................................................................................................94.2.1LED显示器工作原理.................................................................................................94.2.2LED显示器接口.........................................................................................................94.3系统设计......................................................................................................................105软件设计.........................................................................................................................115.1PC机程序设计............................................................................................................
本文标题:单片机与PC机串行通信系统设计
链接地址:https://www.777doc.com/doc-5163516 .html