基于UART串口的多机通讯  被引量:15

A multi-microcontroller communication method based on UART asynchronous serial communication protocol

在线阅读下载全文

作  者:马金平 MA Jinping(School of Mechanical Engineering,Shandong University,Jinan 250061,Shandong,China)

机构地区:[1]山东大学机械工程学院,山东济南250061

出  处:《山东大学学报(工学版)》2020年第3期24-30,共7页Journal of Shandong University(Engineering Science)

基  金:国家科技部创新方法工作专项资助项目(2017IM030100)。

摘  要:针对目前不同物联网设备之间多机通讯模块繁多、设备结构复杂、成本高的问题,提出一种基于通用异步收发传输器(universal asynchronous receiver/transmitter, UART)串口的多机通讯方法。基于微控制器自带的UART串口通讯方式,利用控制线控制通讯设备对通信线路的占用,采用主从控制策略,设定通讯协议和通讯主机、从机,主机作为信息转发和识别的单元,从机组成信息处理的单元,并通过通讯协议实现多从机扩展的功能。通过移植μC/OS-II操作系统到STM32微控制器上,借助μC/OS-II的实时多任务特性,将信息的接收、发送和识别设计成不同优先级的任务。试验结果表明,多机分时通讯方法能够实现主机、从机的信息接收、发送、识别的功能和多机可靠稳定的通讯,解决传统UART方式无法实现多机互相通讯的问题,为物联网设备的多机通讯提供一种可行方案。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-II operating system to the STM32 microcontroller, and using the real-time multitasking characteristics of μC/OS-II, 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.

关 键 词:串口 多机通讯 通讯协议 微控制器 嵌入式系统 

分 类 号:TP391.8[自动化与计算机技术—计算机应用技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象