检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:黄克亚 余雷[1] 李晓旭[1] HUANG Keya;YU Lei;LI Xiaoxu(College of Mechanical and Electrical Engineering,Soochow University,Suzhou 215131,China)
出 处:《现代电子技术》2022年第10期21-25,共5页Modern Electronics Technique
基 金:国家自然科学基金项目(61971297);江苏省自然科学基金面上项目(BK20201201);江苏省一流本科专业项目(2019电气)。
摘 要:为克服传统串行通信接口USART实验设计存在的只注重软件不关注硬件、只进行验证不进行应用、只编写微控制器程序不开发上位机软件等不足,文中设计STM32与PC机串口通信教学实验。硬件设计采用CH340G芯片实现USB转串口功能,实现供电、下载、通信三者合一。软件设计方面,独立完成微控制器程序设计和上位机软件开发两部分工作,并提出一种串口通信应用层协议,合并2位控制位和6位数据位形成单字节数据帧,突破单次发送数据顺序和大小的限制。该协议具有简洁、高效、灵活等优点。实验在微控制器与上位机之间建立双向数据传输通道以实现网络时间同步,测试显示系统稳定、通信可靠,可达到预期效果。实践结果表明,所设计实验软硬件兼顾,系统设计能力考察全面,具有较强的工程实践意义和良好的可扩展性。In order to overcome the shortcomings of traditional serial communication interface designed for USART(universal synchronous/asynchronous receiver/transmitter) experiment,such as only focusing on software,but not paying attention to hardware,only verifying but not performing application,only writing microcontroller program but not developing host computer software,a teaching experiment of serial communication between STM32 and PC is designed in this paper. In the hardware design,the CH340G chip is used to realize the function that the USB is converted to serial port,which can realize the unification of power supply,download and communication. In the software design,the microcontroller program design and the upper computer software development are completed independently,and a serial port communication application layer protocol is proposed,which can combine 2-bit control bits and 6-bit data bits to form a single byte data frame,and break through the limitation of the order and size of single data transmission. The protocol has the advantages of simplicity,efficiency and flexibility. For the experiment,a bidirectional data transmission channel between the microcontroller and the upper computer is established to realize the network time synchronization. The testing results show that the system is stable, has reliable communication, and can achieve the expected effects. The practice results show that the designed experiments can give consideration to software and hardware,the system design ability is comprehensively investigated,and has strong engineering practice significance and good expandability.
关 键 词:串口通信 教学实验 通信协议 微控制器 PC端程序设计 实验设计 数据传输
分 类 号:TN911-34[电子电信—通信与信息系统] TP23[电子电信—信息与通信工程]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.7