安徽工程大学机电学院毕业设计(论文)I单片机双机通信系统设计摘要本单片机系统采用AT89C51控制,LED显示、键盘、串行通信等模块组成。本设计只完成了单片机部分的开发设计,没有设计外部的采集和控制电路。因为没有外部采集电路,所以不能完成具体的测量功能,要完成具体的测量功能(如测量压力、温度、湿度)还要配上外部的各种传感器采集电路和相应的软件。单片机双机通信是指由两台单片机组成的网络结构,可以通过串行通信方式实现对某一过程的最终控制。随着计算机技术的发展,双机通信技术也在不断地发展,现在发展比较成熟的还有光纤通信等。由于计算机的飞速发展和控制系统的复杂化,双机通信已经越来越为人们热门的话题之一。目前,单片机多机通信的形式比较多,但通常可以分为星型、环型、串行总线型和主从式多机型四种。若配上采集电路和相应的软件就能将测量结果用LED数码管十进制显示出来,还可以用按键来控制,进行人机对话;系统中设置了2个按键,1个控制A机,另外一个控制B机,双机之间可以实现简单的通信。之所以没有设计外部采集电路是因为设计了外部采集电路系统的功能就比较单一,不方便系统功能的外部扩展。关键词:单片机AT89C51;串行通信;LED数码管显示王文远:单片机双机通信系统的设计IISCMDoubleCommunicationSystemDesignAbstractItadoptsAT89C51tocontroltheSingleChipmicrocomputersystem,thewholehardwaresystemiscomposedofLEDdisplay,keyboard,serialcommunication.Thedesignhasonlycompletedpartoftheexploitationdesignandhasnotdesignedthecircuitofexternalcollectionandcontrol.Becauseofhavingnotfinishedtheexternalcollectioncircuit,thematerialfunctionofmeasuringhasnotbeenfinished,inordertofinishthematerialfunctionofmeasuringsuchasmeasuringthepressure,temperatureorthemoisture,anditshouldbeequipedwithexternalsensorcollectioncircuitandtherelevantsoftware.SCMdoublecommunicationreferstothenetworkstructureiscomposedoftwosinglechipmicrocomputer,canrealizeserialcommunicationoftheultimatecontrolofaprocess.Withthedevelopmentofcomputertechnology,communicationtechnologyoftwoisinconstantdevelopment,thedevelopmentofmorematurenowandopticalfibercommunication,etc.Duetotherapiddevelopmentofcomputerandthecomplicatedcontrolsystem,doublemachinecommunicationhasbeenoneofthemoreandmorepopulartopicforpeople.Atpresent,theSCMmultimachinecommunicationintheformofmore,butusuallycanbedividedintoserialmainlinestar,ring,andthemaster-slavemodelfourmore.Ifcollectioncircuitandtherelevantsoftwareareequiped,itcanrealizethatthemetricalresultsaredisplayedbynumeraltubeLEDintermofdecimalsystem,italsocanbecontrolledbykeystroke,makestheman-machineconversation.Thesystemhasbeensetupinthetwobuttons,onetocontrolAmachine,anothercontrolBmachine,doublemachinecanrealizesimplecommunication.Thereasonwhytheexternalcollectioncircuithasnotbeendesignedisbecausethatthefunctionofitwillbesingleifitisdesignedanditwillnotbeconvenienttospreadthefunctionofthesystem.Keywords:MicrocomputerAT89C51;serialcommunication;LEDnumeraltubedisplay安徽工程大学机电学院毕业设计(论文).III目录引言...........................................................................................................................................................-1-第1章绪论...........................................................................................................................................-2-1.1系统开发背景和系统设计的意义.............................................................................................-2-1.2设计目标..........................................................................................................................................-2-1.3设计方案的选择.............................................................................................................................-3-1.4论文结构..........................................................................................................................................-4-第2章硬件系统设计.........................................................................................................................-5-2.1硬件设计框图.................................................................................................................................-5-2.2系统的硬件详细设计...................................................................................................................-5-2.3主要芯片的介绍.............................................................................................................................-7-2.3.1单片机AT89C51...................................................................................................................-7-2.3.2MAX232芯片.........................................................................................................................-8-2.4各功能模块电路的设计...............................................................................................................-8-2.4.1串行通信电路.......................................................................................................................-8-2.4.2单片机外围电路..................................................................................................................-9-2.4.4LED数码管显示电路.......................................................................................................-10-2.4.5键盘电路..............................................................................................................................-11-第3章软件系统设计.......................................................................................................................-13-3.1主程序流程图...............................................................................................................................-13-3.2部分子模块程序设计.................................................................................................................-14-3.2.2串行通信模块..........