《(完整word版)51单片机与PC机通信资料.pdf》由会员分享,可在线阅读,更多相关《(完整word版)51单片机与PC机通信资料.pdf(13页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、专业综合实习报告专业:电子信息工程年级:2013 级指导教师:学生:精品资料-欢迎下载-欢迎下载 名师归纳-第 1 页,共 13 页 -目录一:实验项目名称二:前言三:项目内容及要求四:串口通信原理五:设计思路5.1 虚拟串口的设置 5.2下位机电路和程序设计 5.3串口通信仿真六:电路原理框图七:相关硬件及配套软件7.1 AT89C51器件简介7.2 COMPIN 简介7.3 MAX232 器件简介7.4 友善串口调试助手7.5 虚拟串口软件 Virtual Serial Port Driver 6.9八:程序设计九:proteus仿真调试十:总结十一:参考文献一:实验项目名称:精品资料-欢
2、迎下载-欢迎下载 名师归纳-第 2 页,共 13 页 -文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S
3、5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2
4、S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C
5、8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N
6、2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9
7、P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A
8、5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9基于 51 单片机的单片机与PC 机通信二:前言在国内外,以 PC机作为上位机,单片机作为下位机的控制系统中,PC机通常以软件界面进行人机交互,以串行通信方式与单片机进行积极交互,而单片机系统根据被控对象配置
9、相应的前向,后向信息通道,工作时作为主控机测对象,作为被控机接受PC机监督,指挥,定期或受命向上位机提供对象及本身的工作状态信息。目前,随着集成电路集成度的增加,电子计算机向微型化和超微型化方向发展,微型计算机已成为导弹,智能机器人,人类宇宙和太空和太空奥妙复杂系统不可缺少的智能部件。在一些工业控制中,经常需要以多台单片机作为下位机执行对被控对象的直接控制,以一台PC机为上位机完成复杂的数据处理,组成一种以集中管理、分散控制为特点的集散控制系统。为了提高系统管理的先进性和安全性,计算机工业自动控制和监测系统越来越多地采用集总分算系统。较为常见的形式是由一台做管理用的上位主计算机(主机)和一台直
10、接参与控制检测的下位机(单片机)构成的主从式系统,主机和从机之间以通讯的方式来协调工作。主机的作用一是要向从机发送各种命令及参数:二是要及时收集、整理和分析从机发回的数据,供进一步的决策和报表。从机被动地接受、执行主机发来的命令,并且根据主机的要求向主机回传相应烦人实时数据,报告其运行状态。用串行总线技术可以使系统的硬件设计大大简化、系统的体积减小、可靠性提高。同时,系统的更改和扩充极为容易。MCS-51系列单片机,由于内部带有一个可用于异步通讯的全双工的穿行通讯接口,阴齿可以很方便的构成一个主从式系统。串口是计算机上一种非常通用的设备通讯协议,大多数计算机包容两个基于RS232的串口。串口同
11、时也是仪器仪表设备通过用的通讯协议,很多GPIB兼容的设备也带有 RS-232口。同时串口通讯协议也可以用于获取远程采集设备数据。所以,深入的理解学习和研究串口通信相关知识是非常必要的。此次毕业设计选题为“PC机与 MCS-51单片机的串口通讯”,使用51 单片机来实现一个主从式精品资料-欢迎下载-欢迎下载 名师归纳-第 3 页,共 13 页 -文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编
12、码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z1
13、0 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1
14、 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文
15、档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1
16、Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5
17、T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S
18、9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9的总线通讯系统。通过此次设计,对串口通讯的原理和应用融会贯通,为以后的时间工作储备知识和研究方法。三项目内容及要求基于 51 单片机,在相关软件的辅助下,建立起单片机与PC 机之间的通信机制,使用 proteus 仿真软件进行仿真,要求可从PC 机上发送数字及英文字母出来,由单片机接收并在虚拟软件显示屏上显现出来,有开关控制数字或者是字母的发送。四:串口通信原理单片机与外围部件或设备的数据传输方式有并行通信和串行通信两种方式,本实验主要通过串行通信方式进行单片机与PC机之间的数据传输,故略去并行通信方式的介绍。
19、串行通信是指计算机主机与外设之间以及主机系统 与主机系统之间数据的串行传送。使用一条数据线,将数据一位一位地依次传输,每一位数据占据一个固定的时间长度。其只需要少数几条线就可以在系统间交换信息,特别适用于计算机与计算机、计算机与外设之间的远距离通信。串口通信 时,发送和接收到的每一个字符实际上都是一次一位的传送的,每一位为 1 或者为 0。这种传送方式具有方法简单,灵活性强,可靠性高等特点,同时需要的传送线少,适于远距离传送。但是,由于数据是按位发送出去的,因此这种数据传送方式比并行通信速率低。串行通信又可以分为同步通信和异步通信两种方式。同步通信是指同步通信是一种比特同步通信技术,要求发收双
20、方具有同频同相的同步时钟信号,只需在传送报文的最前面附加特定的同步字符,使发收双方建立同步,此后便在同步时钟的控制下逐位发送/接收。进行数据传输时,发送和接收双方要保持完全的同步,因此,要求接收和发送设备必须使用同一时钟。相对于同步通信,异步通信在发送字符时,所发送的字符之间的时隙可以是任意的,当然,接收端必须时刻做好接收的准备(如果接收端主机的电源都没有加上,那么发送端发送字符就没有意义,因为接收端根本无法接收)。发送端可精品资料-欢迎下载-欢迎下载 名师归纳-第 4 页,共 13 页 -文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C
21、8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N
22、2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9
23、P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A
24、5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M
25、2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5
26、R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ
27、2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9以在任意时刻开始发送字符,因此必须在每一个字符的开始和结束的地方加上标志,即加上开始位和停止位,以便使接收端能够正确地将每一个字符接收下来。内部处理器在完成了相应的操作后,通过一个回调的机制,以便通知发送端发送的字符已经得到了回复。五设计思路 Pc机和单片机的串口通信系统的调试一般通过一根串口连接线把带有软件上位机的(Pc 机)和下位机(即单片机)连接起来进行,用这
28、种调试串口通信程序比较烦琐。本文介绍一种用纯软件实现PC机和单片机串口通信的仿真的方法,所有的调试都在一台电脑上通过软件完成。上位机由Pc机代替,下位机由用PROTEUS软件设计的 AT89C51 单片机仿真电路代替串口及连接通过由虚拟串口软Virtual Serial Port Driver 6.9进行连接。5.1 虚拟串口的设置安装虚拟串口软件Virtual Serial Port Driver 6.9,然后打开,左边上面的 COMl是电脑上实际的物理串口,下面是虚拟串口,在没有设置前是空的。因为电脑最多有两个物理串口,将圆圈里的串口改为COMl,COM3,点击 Add pair,这就表示
29、,利用这个软件将计算机的串口l 和模拟串口 3 联接了起来,这两个串口可以进行通信了。精品资料-欢迎下载-欢迎下载 名师归纳-第 5 页,共 13 页 -文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10
30、HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 Z
31、L6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编
32、码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z1
33、0 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1
34、 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文
35、档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S95.2 下位机电路和程序设计用 Proteus6 9 设计的仿真电路只用了几个元器件。由于两个虚拟串口采用相同
36、的标准电平,因此电路中用来作,ITllL电平向 RS232电平转换的电路在仿真电路中可以省略。单片机的实例程序用Keil C51语言编写,串口接收数据采用中断的方式,发送数据采用外部中断的方式,用按钮开关控制数据的发送。5.3 串口通信仿真打开友善串口调试助手,修改串口为 COM3,波特率为 9600,校验位为 None,数据位 8,停止位为 1。用 Proteus 打开仿真电路文件,先设置 AT89C51的属性,右击选中 AT89C5l,再用左键单击 AT89C51,在出现的属性对话框里点击Program File 后的打开按钮,找到自Keil 源程序编译好的 HEX文件后单击打开,然后在
37、Clock Frequency 后填写 12M。单击 OK接下来打开串口 COMPIN 的属性对话框,在 PhsicalPort后选择 COMl,波特率为 9600,校验位为 None,数据位 8,停止位为 l。设置好后,启动仿真就可以实现电脑和单片机串口通信的仿真了。首先演示一下单片机向计算机的串口发送数据。拨动开关向右拨,运行,按一下开关。虚拟串口终端最示单片机向计算机 COMl发送的数据,而计算机的COMI已经和精品资料-欢迎下载-欢迎下载 名师归纳-第 6 页,共 13 页 -文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1
38、Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5
39、T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S
40、9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8
41、K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2
42、S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P
43、2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5
44、C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9COM3 相连,因软件 PROTEUS 所此可以在 COM3 收到单片机发送给 COMi的数据。接着冉演示一下计算机的串口向单片机发送数据。拨动开关向左拨,在口调试助手中输入想要发送的数据,点击手动则字符串由 COM3 发送给了计算机的COMI。再由 COMI发送给单片机。单片机的程序里面有回显功能,将接送给了 COM 因此可以在 COM3 的接受框内能够接收到会显得字符
45、串。六电路原理框图精品资料-欢迎下载-欢迎下载 名师归纳-第 7 页,共 13 页 -文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C
46、8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N
47、2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9
48、P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A
49、5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M
50、2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5R9P2S9文档编码:CQ2A5C8K1Z10 HD6M2N2S5T1 ZL6U5