首页 | 本学科首页   官方微博 | 高级检索  
     

PC机与AVR单片机之间串行通信的实现
引用本文:丁易新.PC机与AVR单片机之间串行通信的实现[J].现代电子技术,2005,28(12):32-34.
作者姓名:丁易新
作者单位:安徽工业大学,电气信息学院,安徽,马鞍山,243002
摘    要:基于RS232串行通信协议,阐述了一种PC机与AVR系列单片机Atmega128之间串行通信的实现方式,实现了PC机与单片机间数据的双向传输。其中PC机为主发送端,单片机为主接收端。硬件上,简单介绍了利用MAX232E芯片解决PC机与单片机电气规范不一致的方法。软件上,PC机端通信程序采用C语言嫡程,运用Turbo C库函数bios.h中提供的调用BIOS软中断的函数bioscom()实现;单片机端通信程序采用C51嫡程,使用UART接收结束中断、UART发送结束中断。本文提供了相关C语言和C51源程序。

关 键 词:AVR单片机  串行通信  C51源程序  MAX232E
文章编号:1004-373X(2005)12-032-03
修稿时间:2005年1月18日

Realization of Serial Communication between PC and AVR Single Chip
Ding Yixin.Realization of Serial Communication between PC and AVR Single Chip[J].Modern Electronic Technique,2005,28(12):32-34.
Authors:Ding Yixin
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.
Keywords:AVR single chip computer  serial communication  C51 program  MAX232E  
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号