Journal of Shandong University(Engineering Science) ›› 2020, Vol. 50 ›› Issue (3): 24-30.doi: 10.6040/j.issn.1672-3961.0.2019.705

• Machine Learning & Data Mining • Previous Articles     Next Articles

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

Jinping MA()   

  1. School of Mechanical Engineering, Shandong University, Jinan 250061, Shandong, China
  • Received:2019-11-19 Online:2020-06-20 Published:2020-06-16
  • Supported by:
    国家科技部创新方法工作专项资助项目(2017IM030100)

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.

Key words: serial port, multi-microcontroller communication, communication protocol, microcontroller, embedded systems

CLC Number: 

  • TP391.8

Fig.1

Connection schematic diagram between master and slaves"

Fig.2

Comparison of TLL and RS-232 level"

Table 1

Communication protocol structure betweenmaster and slave bit"

数据 长度
信号头 8
通讯类型 8
源地址 8
目标地址 8
帧长度 7
奇偶校验 1
信号结尾 32
信号内容 0~920

Fig.3

Task scheduling principle of μC/OS-Ⅱ"

Fig.4

Microcomputer core board structure"

Fig.5

Chip of TTL to RS-232"

Fig.6

Wirings layout of master and slave"

Table 2

Test protocol encoding"

数据 数值
信号头 AA
通讯类型 00
源地址 **
目标地址 **
帧长度 0B
奇偶校验 **
信号结尾 CC 33 3C C3
信号内容 01

Fig.7

Message received by master and slaves"

1 徐翀, 杨锐涛, 成正涛. 物联网环境下的智能家居发射控制系统的设计[J]. 科技风, 2019, (30): 103.
XU Chong , YANG Ruitao , CHENG Zhengtao . Design of smart home launch control system in internet of things environment[J]. Technology Wind, 2019, (30): 103.
2 ALOZIE A , WESTPHAL B , KISCHE S . Surgical revision after percutaneous mitral valve repair by edge-to-edge device: when the strategy fails in the highest risk surgical population[J]. European Journal of Cardio Thoracic Surgery, 2014, 46 (1): 55- 60.
3 GHANBARI Z , JAFARI N N , HOSSEINZADEH M , et al. Resource allocation mechanisms and approaches on the internet of things[J]. Cluster Computing, 2019, (22): 102- 106.
4 ALVI S A, SHAH G A, MAHMOOD W. Energy efficient green routing protocol for internet of multimedia things[C]//2015 IEEE Tenth International Conference on Intelligent Sensors, Sensor Networks and Information Processing (ISSNIP). Singapore: IEEE, 2015: 426.
5 赵红焱. 基于Delphi的实验室设备通讯实现[J]. 涟钢科技与管理, 2019, (5): 60- 62.
ZHAO Hongyan . Delphi-based laboratory equipment communication implementation[J]. Lian Steel Technology and Management, 2019, (5): 60- 62.
6 王广斌. 基于串口的OPC通讯技术在油库的应用[J]. 石油库与加油站, 2019, 28 (4): 25- 28.
WANG Guangbin . Application of OPC communication technology based on serial port in oil depot[J]. Oil Depot and Gas Station, 2019, 28 (4): 25- 28.
7 赵健, 张鑫褆, 李佳明, 等. 群体智能2.0研究综述[J]. 计算机工程, 2019, 45 (12): 1- 7.
ZHAO Jian , ZHANG Xinti , LI Jiaming , et al. Research review of crowd intelligence 2.0[J]. Computer Engineering, 2019, 45 (12): 1- 7.
8 孙文磊, 张学东, 熊宗慧, 等. 智能制造及其关键技术[J]. 新疆大学学报(自然科学版), 2019, 36 (4): 379- 386.
SUN Wenlei , ZHANG Xuedong , XIONG Zonghui , et al. Intelligent manufacturing and its key technologies[J]. Journal of Xinjiang University (Natural Science Edition), 2019, 36 (4): 379- 386.
9 SHINICHI Fujimoto , HIROSHI Inai , JIRO Yamakita . Performance evaluation of packet reassembly at an edge device in ATM-LANS[J]. Electronics & Communications in Japan, 2001, 84 (1): 40- 48.
10 蒋元中, 金浪滨, 汤杭森, 等. 基于串口通讯的闸站监控数据共享方案的设计与实现[J]. 浙江水利科技, 2019, 47 (1): 62- 63.
JIANG Yuanzhong , JIN Langbin , TANG Hangsen , et al. Design and implementation of monitoring data sharing scheme based on serial port communication[J]. Zhejiang Hydrotechnics, 2019, 47 (1): 62- 63.
11 林宏翔, 罗中良, 魏晓慧, 等. 基于串口通讯的程控射频开关控制器设计[J]. 日用电器, 2018, (10): 94- 98.
LIN Hongxiang , LUO Zhongliang , WEI Xiaohui , et al. Design of remote RF switch controller based on serial communication[J]. Electrical Appliances, 2018, (10): 94- 98.
12 张兴宇, 韩策, 曹雷天, 等. 基于串口触摸屏在机电控制系统中的应用[J]. 科技经济导刊, 2018, 26 (18): 46.
ZHANG Xingyu , HAN Ce , CAO Leitian , et al. Application of touch screen based on serial port in electromechanical control system[J]. Technology and Economic Guide, 2018, 26 (18): 46.
13 路染妮. 探究单片机的多串口扩展技术的设计[J]. 自动化与仪器仪表, 2018, (9): 137- 140.
LU Ranni . The design of multi serial port expansion technology[J]. Automation and Instrumentation, 2018, (9): 137- 140.
14 邵金菊, 曲金玉, 高松, 等. 基于RS232串行通信的测距综合实验设计[J]. 教育现代化, 2019, 6 (68): 134- 136.
SHAO Jinju , QU Jinyu , GAO Song , et al. Comprehensive experimental design of ranging based on RS232 serial communication[J]. Education Window, 2019, 6 (68): 134- 136.
15 黄建刚, 张敏, 罗正华. 支持多点远距离通信的RS-232串行总线系统[J]. 成都大学学报(自然科学版), 2017, 36 (2): 172- 175.
HUANG Jiangang , ZHANG Min , LUO Zhenghua . RS-232 serial bus system supporting multi-point long-distance communication[J]. Journal of Chengdu University (Natural Science Edition), 2017, 36 (2): 172- 175.
16 张思超.基于uC/OS-Ⅱ的多路信号采集及控制系统[D].济南:山东师范大学, 2016.
ZHANG Sichao. Multi-channel signal acquisition and control system based on uC/OS-Ⅱ[D]. Jinan: Shandong Normal University, 2016.
17 楚红雨, 李磊民, 黄玉清, 等. 实时操作系统uC/OS-Ⅱ在ARM9上移植的实现[J]. 计算机工程, 2005, 31 (20): 226- 228.
CHU Hongyu , LI Leimin , HUANG Yuqing , et al. Implementation of porting RTOS uC/OS-Ⅱ to ARM9[J]. Computer Engineering, 2005, 31 (20): 226- 228.
18 拉伯罗斯, 邵贝贝. uC/OS-Ⅱ:源码公开的实时嵌入式操作系统[M]. 北京: 中国电力出版社, 2001.
19 梁小骜, 宋庆国, 王勃. uCOS-Ⅲ在Cortex-M4平台上的移植和实现[J]. 电子技术与软件工程, 2017, (16): 199- 201.
LIANG Xiaoao , SONG Qingguo , WANG Bo . Migration and implementation of uCOS-Ⅲ on the Cortex-M4 platform[J]. Electronic Technology and Software Engineering, 2017, (16): 199- 201.
No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
[1] ZHANG Yong-hua,WANG An-ling,LIU Fu-ping . The reflected phase angle of low frequent inhomogeneous[J]. JOURNAL OF SHANDONG UNIVERSITY (ENGINEERING SCIENCE), 2006, 36(2): 22 -25 .
[2] SHI Lai-shun,WAN Zhong-yi . Synthesis and performance evaluation of a novel betaine-type asphalt emulsifier[J]. JOURNAL OF SHANDONG UNIVERSITY (ENGINEERING SCIENCE), 2008, 38(4): 112 -115 .
[3] HAN Xue. Example analysis for landslide hazard remote monitoring at  the Pingzhuang west open-pit mine[J]. JOURNAL OF SHANDONG UNIVERSITY (ENGINEERING SCIENCE), 2009, 39(4): 116 -120 .
[4] LI Liang, LUO Qiming, CHEN Enhong. Graph-based ranking model for object-level search
[J]. JOURNAL OF SHANDONG UNIVERSITY (ENGINEERING SCIENCE), 2009, 39(1): 15 -21 .
[5] CHEN Rui, LI Hongwei, TIAN Jing. The relationship between the number of magnetic poles and the bearing capacity of radial magnetic bearing[J]. JOURNAL OF SHANDONG UNIVERSITY (ENGINEERING SCIENCE), 2018, 48(2): 81 -85 .
[6] QIN Tong, SUN Fengrong*, WANG Limei, WANG Qinghao, LI Xincai. 3D surface reconstruction using the shape based interpolation guided by maximal discs[J]. JOURNAL OF SHANDONG UNIVERSITY (ENGINEERING SCIENCE), 2010, 40(3): 1 -5 .
[7] LIU Zhongguo,ZHANG Xiaojing,LIU Boqiang,LIU Changchun, . The development of ultrasonic characterization of the biological tissue elasticity[J]. JOURNAL OF SHANDONG UNIVERSITY (ENGINEERING SCIENCE), 2006, 36(3): 34 -38 .
[8] WANG Yong, XIE Yudong. Gas control technology of largeflow pipe[J]. JOURNAL OF SHANDONG UNIVERSITY (ENGINEERING SCIENCE), 2009, 39(2): 70 -74 .
[9] CHEN Huaxin, CHEN Shuanfa, WANG Binggang. The aging behavior and mechanism of base asphalts[J]. JOURNAL OF SHANDONG UNIVERSITY (ENGINEERING SCIENCE), 2009, 39(2): 125 -130 .
[10] BO De-Yun, ZHANG Dao-Jiang. Adaptive spectral clustering algorithm[J]. JOURNAL OF SHANDONG UNIVERSITY (ENGINEERING SCIENCE), 2009, 39(5): 22 -26 .