云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 单片机多机通信实现

单片机多机通信实现

  • 62 次阅读
  • 3 次下载
  • 2025/6/18 4:56:38

单片机多机通信实现

摘要:目前,单片机在多机通信领域应用很广。但研究最多的是上位机与下位

机的通信及多单片机构成的主从式多机通信系统。本文重点研究了多单片机的平权式多机通信,使各单片机有相同的权限。

本文从平权式多机通信协议入手,首先设计了具体平权式多机通信协议;主机通信用按键控制,模拟实际应用中的触发信号输入。对于1号单片机,还可通过液晶实时显示工作状态,初始为主机。在不需置其他单片机为主机的情形下,本多机通信系统可以作为主从式多机通信系统。从机通信模式通过串口中断触发启动,通信结束即恢复之前的从机状态。通信过程中,主机先发送寻址的从机号,待从机响应后开始通信。通信结束后,主机发送自己的主机号,告知从机。然后从机发给主机校验字节数据,主机检验错误,检验无误后,作出响应,1号单片机液晶会显示,2号和3号单片机收发数据无误后会使LED指示灯亮起。其外,本文研究了可切换双向接口的实现方法。通过用单片机的一个引脚控制单片机的串口的连接方式,使其工作在主机模式或从机模式。

本研究已经仿真通过,真实可行。具有一定的检错能力,串行通信的比特率是9600bit/s,通信速度较快,且可靠性高。本研究通过硬件电路解决了通信过程中多单片机争用主机权的问题。

关键词:单片机;多机通信;平权;AT89S52

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

I

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 communication process to resolve the contention over the host microcontroller over the issue.

Key words::SCM;Multi-machine communication;Equal rights; AT89S52

目录

1 绪论....................................................................... 1 1.1 论文研究的背景与意义 ..................................................... 1 1.2 单片机多机通信领域的历史及国内外发展现状 ................................. 1 1.3 本论文的研究内容 ......................................................... 2 2 单片机多机通信理论及方案选择 ............................................... 3 2.1 单片机串口通信 ........................................................... 3 2.2 单片机多机通信方案选择 ................................................... 5 2.3 微处理器的选择 ........................................................... 5 2.4 液晶LCD1602介绍 ......................................................... 9 3 单片机多机通信协议设计 .................................................... 15 4 硬件电路设计 .............................................................. 16 4.1 单片机最小系统的设计 .................................................... 16 4.2 矩阵键盘电路设计 ........................................................ 17 4.3 液晶显示电路设计 ........................................................ 18 4.4 可切换接口电路设计 ...................................................... 19 4.5 2号与3号单片机按键电路设计 ........................................... 23 4.6 LED显示电路设计 ....................................................... 23 4.7 主机权分配电路设计 ..................................................... 24 4.8 电源电路设计 ........................................................... 28 5 软件设计 .................................................................. 29 5.1 多机通信协议的算法设计 ................................................. 29 5.2 键盘程序设计 ........................................................... 32 5.3 系统初始化程序设计 ..................................................... 35 6 结论...................................................................... 35 参考文献 .................................................................... 36 致谢........................................................................ 37

II

附录1:1号单片机电路原理图 ................................................. 38 附录2:2号单片机电路原理图 ................................................. 39 附录3:3号单片机电路原理图 ................................. 错误!未定义书签。 附录4:仿真电路图 .......................................................... 42 附录5:源程序: ............................................................ 43

I

搜索更多关于: 单片机多机通信实现 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

单片机多机通信实现 摘要:目前,单片机在多机通信领域应用很广。但研究最多的是上位机与下位机的通信及多单片机构成的主从式多机通信系统。本文重点研究了多单片机的平权式多机通信,使各单片机有相同的权限。 本文从平权式多机通信协议入手,首先设计了具体平权式多机通信协议;主机通信用按键控制,模拟实际应用中的触发信号输入。对于1号单片机,还可通过液晶实时显示工作状态,初始为主机。在不需置其他单片机为主机的情形下,本多机通信系统可以作为主从式多机通信系统。从机通信模式通过串口中断触发启动,通信结束即恢复之前的从机状态。通信过程中,主机先发送寻址的从机号,待从机响应后开始通信。通信结束后,主机发送自己的主机号,告知从机。然后从机发给主机校验字节数据,主机检验错误,检验无误后,作出响应,1号单片机液晶会显示,2号和3号单片

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com