摘要
针对主从模式带来的通信延迟、冗余通信等问题,设计一种基于RS485多主对等通信方式,实现RS485通信线路上多主机对等通信功能,不需要主机轮询通信。对通信线路进行设计,在原有RS485通信线路基础上增加一条控制线路,用于检测通信线路的工作情况。移植uC/OS-Ⅱ实时操作系统到STM32F103C8T6控制板上,利用uC/OS-Ⅱ的实时多任务特性,实现通信线路检测、数据接收、数据发送及其他任务的同时运行,提高通信系统的工作效率。采用数据缓冲、数据队列、循环冗余校核(cyclic redundancy check,CRC)校验等方式,提高数据接收与发送的稳定性和可靠性,解决数据量增加带来的数据混乱、传输不稳定等问题。通过搭建试验系统,实现预期的通信功能,验证多主对等通信的可行性,为联网设备通信提供一种新方法。
For the problem such as communication delay and redundant communication,a multi-parallel communication method was designed.The function of multi-host peer communication on the RS485 communication line was implemented,and the host polling communication was not required.The communication line had been designed,and a control line was added based on the original RS485 communication line to detect the operation of the communication line.The uC/OS-Ⅱreal-time operating system was trans-planted to the STM32F103C8T6 control panel,using the real-time mulitasking characteristics of uC/OS-Ⅱ,implementing commu-nication line detection,data reception,data transmission,and other tasks,and improving communication system efficiency.The data buffer,data queue,cyclic redundancy check,etc.,were utilized to improve the stability and reliability of data reception and transmission,solving problems,such as data confusion,transmission instability etc.when the amount of data increased.By building an experimental system,the expected communication function was implemented,and the feasibility of multi-parallel communication was verified.A novel method was provided for the communication of the Internet of Things devices.
作者
任瑶瑶
马金平
REN Yaoyao;MA Jinping(Hongshan College,Nanjing University of Finance and Economics,Nanjing 210003,Jiangsu,China;College of Mechanical Engineering,Shandong University,Jinan 250061,Shandong,China)
出处
《山东大学学报(工学版)》
CAS
CSCD
北大核心
2023年第5期156-164,共9页
Journal of Shandong University(Engineering Science)
基金
山东大学教育教学改革与研究资助项目(2022Y114)
山东大学实验室建设与管理研究资助项目(sy20222304)。
关键词
RS485
多机通信
通信转发
通信协议
嵌入式系统
RS485
multi-host communication
communication forwarding
communication protocol
embedded system