结合电子信息工程专业单片机实践教学,提出了单片机和PC机通过RS232接口进行通信的设计方案。首先对单片机与PC机通信的硬件电路进行设计,编写源程序实现单片机与PC机通信。然后在PC机上采用一种可视化、用户界面友好的高级程序语言Visual Basic,编写通讯串口发送与接收程序,并利用虚拟串口软件模拟串口、用Proteus软件设计硬件仿真电路。真正实现了上位机与下位机数据发送与接收功能的在线仿真。
Based on the practice teaching of MCU in electronic information engineering, the idea of the communication of MCU and PC machine through RS232 interface is proposed. First of all, the MCU and PC communication circuit is designed, and the source program is compiled to realize the communication between the MCU and the PC machine . Then, in the PC machine, a visual user interface is designed. High-level programming language Visual Basic is used to write the communication serial port for sending and receiving program. The virtual serial port software is used to simulate the serial port, and the hardware simulation circuit is designed by Proteus software to realize the upper computer and the lower computer data transmission and the reception funetion in on-line simulation.