毕业设计--单片机多机通信实现
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
毕业设计说明书
单片机多机通信实现
摘要:目前,单片机在多机通信领域应用很广。但研究最多的是上位机与下位
机的通信及多单片机构成的主从式多机通信系统。本文重点研究了多单片机的平权式多机通信,使各单片机有相同的权限。本文从平权式多机通信协议入手,首先设计了具体平权式多机通信协议;主机通信用按键控制,模拟实际应用中的触发信号输入。对于 1 号单片机,还可通过液晶实时显示工作状态,初始为主机。在不需置其他单片机为主机的情形下,本多机通信系统可以作为主从式多机通信系统。从机通信模式通过串口中断触发启动,通信结束即恢复之前的从机状态。通信过程中,主机先发送寻址的从机号,待从机响应后开始通信。通信结束后,主机发送自己的主机号,告知从机。然后从机发给主机校验字节数据,主机检验错误,检验无误后,作出响应,1 号单片机液晶会显示,2 号和3 号单片机收发数据无误后会使LED 指示灯亮起。其外,本文研究了可切换双向接口的实现方法。通过用单片机的一个引脚控制单片机的串口的连接方式,使其工作在主机模式或从机模式。本研究已经仿真通过,真实可行。具有一定的检错能力,串行通信的比特率是9600bit/s,通信速度较快,且可靠性高。本研究通过硬件电路解决了通信过程中多单片机争用主机权的问题。
关键词:单片机;多机通信;平权;AT89S52
I
盐城工学院本科生毕业设计说明书
(2010)
Realization of many SCM communication
Abstract:At present, the single chip multi-machine communication in a wide field :
of applications. However, the most studied is the host computer and lower computer communications and multi-chip microprocessor master-slave multi-machine
communication system. This paper focuses on a number of single chip multi-machine communication affirmative, so that the MCU has the same permissions. The paper machine from the multi-level communication protocol of the right to start with, first, the specific communication protocol. Host Communication button control, the practical application of simulation in the trigger signal input. For the No. 1 microcontroller, but also through the LCD display working status, the initial for the host. No other single chip set in the case of the host, the multi-machine communication system can be used as master-slave multi-machine communication system. Communication mode from the machine through the serial port interrupt triggering, communication before the end of the recovery from the machine state. Communication process, the host sends the address number from the machine until the response from the plane after communications. After communication, the host sends its own host number, informed from the machines. And then distributed to the host from the machine check bytes of data, the host test error, test and proved correct response, 1 single chip LCD displays, 2 and 3, after the MCU will send and receive data correct LED light is on. Besides, this paper, bi-directional switch implementation of the interface methods. Through the use of microcomputer control of a microcontroller pin serial port connection, to work in master mode or slave mode. This study has been simulated by the real feasible. Have some error detection capability, the bit rate of serial communication 9600bit / s, communication speed, and reliability. In this study, the hardware circuit through the