您好,欢迎访问三七文档
.;...;..摘要随着电子技术的发展和微处理器技术的应用,带有单片机的智能型测控系统的应用越来越广泛,多个单片机系统之间数据传输已经应用于工业、科研、农业等领域,而单片机之间的数据通信最常用的就是串口通信方式,串口通信可以在使用一根线发送数据的同时利用另一根线接收数据,使用简单且能实现远距离通信。本文介绍了一种单片机多机通信的设计方法,主机与从机之间通过串口实现通信,主机通过按键来选择要进行通信的从机,然后通过数字矩阵键盘控制从机的数码管显示数字0-9,同时该从机可以通过按键控制主机连接的LED灯亮灭,实现全双工通信。本文介绍的方法简单易懂,通过仿真基本上实现了上述功能,操作简单,性能稳定,可广泛应用于各种多机通信系统中。关键字:单片机;多机通信;串口;数码管;LED.;..AbstractWiththedevelopmentofelectronictechnologyandtheapplicationofmicroprocessortechnology,intelligentmeasurementandcontrolsystemwithamicrocontrollerapplicationismoreextensive,datatransferbetweenmultipleMCUsystemhasbeenusedinindustrial,research,agricultureandotherfields,whilethemicrocontrollerthemostcommonlyusedfordatacommunicationsbetweentheserialcommunication,serialcommunicationcanusealinetosenddataatthesametimeuseanotherlinetoreceivedata,usingsimpleandcanachievelong-distancecommunications.Thisarticledescribesthedesignmethodofasingle-chipmulti-machinecommunicationviatheserialcommunicationbetweenthehostandslave,tocommunicatefrommachinehostkeystoselect,fromthemachine'sdigitaltubedisplaydigitalanddigitalmatrixkeyboardcontrol-9,whiletheslavecanbethekeycontrolofthehosttoconnecttheLEDlightsbrightlytoextinguish,toachievefull-duplexcommunication.Thisarticledescribesthemethodissimpleandeasytounderstand,basicallythroughsimulationsoftwaretoachievetheabovefunctionality,simpleoperation,stableperformance,canbewidelyusedinavarietyofmulti-machinecommunicationsystem.Keyword:Microcontroller;MultiCommunication;SerialPort;Nixietube;LE.;..目录1引言.........................................................................................................11.1本课题选取的目的及意义...............................................................................11.2本系统的主要研究内容...................................................................................22系统分析.................................................................................................32.1串行通信简介...................................................................................................32.2系统构成...........................................................................................................42.3系统工作原理...................................................................................................43系统硬件设计.........................................................................................53.1电路设计应用环境简介...................................................................................53.2系统硬件总体设计方案...................................................................................53.3主机电路模块...................................................................................................63.3.1单片机...................................................................................................63.3.2矩阵键盘电路.......................................................................................83.3.3主机控制电路.......................................................................................93.4从机电路模块.................................................................................................103.5电源电路模块.................................................................................................113.6元件清单.........................................................................................................124系统软件设计.......................................................................................124.1软件设计应用环境与设计语言.....................................................................124.2软件设计流程.................................................................................................144.3按键程序设计.................................................................................................154.4串口通信.........................................................................................................164.5从机数码管显示程序设计.............................................................................195ProtuesISIS软件仿真..........................................................................195.1Protues仿真软件简介.....................................................................................195.2Proteus功能仿真.............................................................................................215.3Proteus仿真结果.............................................................................................226结论.......................................................................................................25参考文献...................................................................................................26附录1........................................................................................................27附录2........................................................................................................28.;..1引言随着电子技术的不断发展,单片机的应用范围越来越广泛,在工业控制、家电控制、数据采集等多个领域都有着十分重要的作用,由于单片机的使用,越来越多的系统开始向智能化方向发展。而单片机自带的串口功能可以实现其与其他外设MCU或PC机之间的通信,这样就使得控制系统更加的方便实用,利用单片机的串口通信可以实现多单片机之间的数据的远程传输、数据分析与系统综合控制功能,尤其是在数据量比较大的场合下,利用一个主机向各个从机发送控制指令是一个很好的解决方案,在这个过程中,串口通信是实现单片机与单片机之间通信的关键。现在多处理器通信已经在工业、科研、农业等领域广泛地应用。串行通信是指计算机
本文标题:单片机串行多机通信
链接地址:https://www.777doc.com/doc-6596816 .html