摘要
为了实现通过PC上位机控制单片机主机并通过主机控制从机的目的,针对STM32F407芯片设计了一款基于FreeRTOS的多机通信系统。该系统基于FreeRTOS实时操作系统,以STM32F407为核心,PC上位机通过以太网向单片机主机发送信息,同时命令单片机主机通过CAN总线控制单片机从机,实现多机通信。本文将对CAN通信、以太网通信等各个部分进行分析并设计程序软件。实验结果表明,本次设计的多机通信系统能够成功向单片机从机发送信息并接收来自从机的信息,可以实现多个控制模块之间的数据传输,多机之间相互协作,共同完成目标任务。
Abstract
In order to realize the purpose of controlling the single chip computer through the upper computer of the PC,and controlling the slave computer through the single chip computer,a multi-machine communication system based on FreeRTOS for STM32F407 chip is designed.The system is based on FreeRTOS real-time operating system,with STM32F407 as the core,the PC upper computer sends information to the single chip computer host through Ethernet,and CAN command the single chip computer host to control the single chip computer slave through CAN bus,to achieve the purpose of multi-machine communication.This paper will analyze and design program software for CAN communication,Ethernet communication and other parts.The experiment results show that the design of the multi-machine communication system can successfully send information to the slave microcomputer and receive the information from the slave microcomputer,can realize the data transmission between multiple control modules,so as to achieve the mutual cooperation between the multi-computer to complete the target task.
关键词
STM32F407 /
FreeRTOS /
多机通信 /
TCP/IP /
CAN
Key words
STM32F407 /
FreeRTOS /
multi-machine communication /
TCP/IP /
CAN
陈旅超, 蒲泽坤, 沈勇.
STM32F407的FreeRTOS多机通信系统设计[J]. 集成电路与嵌入式系统. 2023, 23(9): 11-15
Chen Lvchao, Pu Zekun, Shen Yong.
Design of Multi-machine Communication System Based on FreeRTOS for STM32F407[J]. Integrated Circuits and Embedded Systems. 2023, 23(9): 11-15
{{custom_sec.title}}
{{custom_sec.title}}
{{custom_sec.content}}
参考文献
[1] 张贺帅,张哲.以单片机为基础多机通信系统的设计对策分析[J].长江信息通信,2022,35(3):117-119.
[2] 杜路泉,莫建麟,王玉晶,等.基于单片机的多机通信系统设计[J].宁德师范学院学报(自然科学版),2021,33(2):153-158.
[3] 胡念祖.基于ARM和嵌入式Web服务器的自动售货机设计[D].西安:西安工程大学,2019.
[4] 吴乐明.基于单片机技术的多机通信系统设计[J].中国新通信,2018,20(9):7-8.
[5] 谭玉琪,王超,汤吉昀.基于Proteus的单片机多机通信的设计与仿真[J].电子设计工程,2019,27(3):164-168.