节点文献

PC机与AVR单片机之间串行通信的实现

Realization of Serial Communication between PC and AVR Single Chip

  • 推荐 CAJ下载
  • PDF下载
  • 不支持迅雷等下载工具,请取消加速工具后下载。

【作者】 丁易新

【Author】 DING Yixin (School of Electrical Engineering & Information, Anhui University of Technology, Ma′anshan,243002,China)

【机构】 安徽工业大学电气信息学院 安徽马鞍山243002

【摘要】 基于RS232串行通信协议,阐述了一种PC机与AVR系列单片机Atmega128之间串行通信的实现方式,实现了PC机与单片机间数据的双向传输。其中PC机为主发送端,单片机为主接收端。硬件上,简单介绍了利用MAX232E芯片解决PC机与单片机电气规范不一致的方法。软件上,PC机端通信程序采用C语言编程,运用TurboC库函数bios.h中提供的调用BIOS软中断的函数bioscom()实现;单片机端通信程序采用C51编程,使用UART接收结束中断、UART发送结束中断。本文提供了相关C语言和C51源程序。

【Abstract】 This paper has explained the realizable way of the serial communication between PC and AVR series single chip computer (Atmega128) on the basis of RS 232 serial communication protocol,the twoway transmission of the data among the PC and single chip computer is realized. The PC is the primary sending end, the single chip computer is the primary receiver. On the hardware, we simply introduce how utilizes the MAX232E chip to solve the disagreement with single chip computer and the PC. On the software, the program in PC is the Turbo C program, it uses the function (bioscom) that is offerd by the library function (bios.h) of Turbo C. The function (bioscom) can carry out the software interrupt of BIOS. The program in single chip computer is C51 program, using the interrupt that UART receive end and the interrupt that UART send end. We offered the C program and C51 program in this paper.

  • 【文献出处】 现代电子技术 ,Modern Electronic Technique , 编辑部邮箱 ,2005年12期
  • 【分类号】TP368
  • 【被引频次】50
  • 【下载频次】1091
节点文献中: