首页 | 官方网站   微博 | 高级检索  
     

基于UART串口的多机通讯
引用本文:马金平.基于UART串口的多机通讯[J].山东大学学报(工学版),2020,50(3):24-30.
作者姓名:马金平
作者单位:山东大学机械工程学院,山东 济南250061
基金项目:国家科技部创新方法工作专项资助项目(2017IM030100)
摘    要:针对目前不同物联网设备之间多机通讯模块繁多、设备结构复杂、成本高的问题,提出一种基于通用异步收发传输器(universal asynchronous receiver/transmitter,UART)串口的多机通讯方法。基于微控制器自带的UART串口通讯方式,利用控制线控制通讯设备对通信线路的占用,采用主从控制策略,设定通讯协议和通讯主机、从机,主机作为信息转发和识别的单元,从机组成信息处理的单元,并通过通讯协议实现多从机扩展的功能。通过移植μC/OS-Ⅱ操作系统到STM32微控制器上,借助μC/OS-Ⅱ的实时多任务特性,将信息的接收、发送和识别设计成不同优先级的任务。试验结果表明,多机分时通讯方法能够实现主机、从机的信息接收、发送、识别的功能和多机可靠稳定的通讯,解决传统UART方式无法实现多机互相通讯的问题,为物联网设备的多机通讯提供一种可行方案。

关 键 词:串口  多机通讯  通讯协议  微控制器  嵌入式系统
收稿时间:2019-11-19

A multi-microcontroller communication method based on UART asynchronous serial communication protocol
Jinping MA.A multi-microcontroller communication method based on UART asynchronous serial communication protocol[J].Journal of Shandong University of Technology,2020,50(3):24-30.
Authors:Jinping MA
Affiliation:School of Mechanical Engineering, Shandong University, Jinan 250061, Shandong, China
Abstract:To reduce the additional communication modules, complexity and costs of the different Internet of Things(IoT) devices communication, a multi-microcontroller communication method based on UART asynchronous serial ports was proposed. Based on the universal asynchronous receiver/transmitter(UART) serial communication method of the microcontroller, the control line was utilized to control the usage of the communication lines by the communication device, and a method of occupying the signal line by multiple machines in a time-sharing manner was realized. The master-slave control strategy was used to set the communication protocol. The master implements signal forwarding and identification, and the slave got signals from the master to achieve reliable and stable communication among multiple machines. By transplanting the μC/OS-Ⅱ operating system to the STM32 microcontroller, and using the real-time multitasking characteristics of μC/OS-Ⅱ, the signal reception, transmission and identification were designed into tasks of different priorities, and the master and the slave were realized. The functions of information receiving, sending and identification and the characteristics of multi-slave expansion were achieved through the communication protocol, solving the problem of multi-microcontroller communication that the traditional UART method could not achieve. The feasibility of the proposed method was verified through experiments, which provided a new solution for multi-microcontroller communication of edge devices in the Internet of Things.
Keywords:serial port  multi-microcontroller communication  communication protocol  microcontroller  embedded systems  
本文献已被 CNKI 万方数据 等数据库收录!
点击此处可从《山东大学学报(工学版)》浏览原始摘要信息
点击此处可从《山东大学学报(工学版)》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号