摘要
基于单片机SPCE061A与PC机进行数据交换而设计了一个串行通信系统,通信方式采用异步串行通信方式。给出了SPCE061A与PC机两者间串行通信时的电平转换的分析说明和串行通信程序设计。通信协议部分给出了通信数据格式和波特率设置,程序设计的关键问题中具体介绍了中断控制单元的设置,最后给出通用异步串行口发送中断程序的设计流程和数据发送接收的部分程序。单片机程序采用汇编语言编写,上位机程序采用VB 6.0语言编写。该串行通信系统已经调试成功并运行良好。
This paper presents a serial communication system in order to satisfy the data exchange between SPCE061 A and PC. It uses the approach of asynchronous serial communication. The conversion of RS 232C and TTL is demonstrated for the difference of level between SPCE061A and PC,as well as the design of program of serial communication is given in the paper. The data format and the baud rate configuration is presented in the communication protocol part, the section of key question in the programming design gives the interruption control unit configuration. Finally, the flow chart of the sending interruption programs by using UART in SPCE061A and the subordinate program of the data sending and receiving are given. The assemble language is used in the single chip computer,while the VB6.0 is adopted in PC. The hardware and software of the system have been successfully debugged and run.
出处
《现代电子技术》
2006年第21期48-50,共3页
Modern Electronics Technique