文档详情

【精品】(最新)本科毕业论文格式模板.doc

发布:2017-09-17约8.26千字共14页下载文档
文本预览下载声明
本科生毕业设计(论文) 题 目:基于VC++实现单片机和PC机的串行通信 ——副标题 姓 名: 李 星 学 号: 110600212 学 院: 物理与信息工程学院 专 业: 电子信息工程 年 级: 2006级 指导教师: (签名) 2010 年 6 月 4 日 基于VC++实现单片机和PC机的串行通信 中文摘要 本论文主要阐述了利用Visual C++ 6.0开发工具实现PC机与单片机串行通信的基本原理和方法。并结合具体实例给出使用RS-232接口进行串行通信的基本程序。 单片机和PC机的串行通信常应用于工业控制检测领域中。单片机常作为下位机,进行数据的采集工作;PC机常作为上位机,进行数据的集中处理。两者间常通过串口进行数据通讯。在Windows 操作系统中,利用VC++开发上位机的监控软件,具有控制界面简洁大方,应用程序短小精悍等优点。 本论文提供了两种方式来实现在PC机上基于VC++的串行通信程序设计。一是使用Windows API 函数进行编写。此种方法应用较广但程序相对比较复杂,开发Windows工控软件难度大大增加。二是使用VC++自带的Microsoft Communication Control 控件(即MSComm 控件)进行编写。此种方法比较简便,使用时只需要在控件属性中进行一些设置,再编写少量的代码即可,但只适用于较简单的系统。我们可以根据实际情况选择合适的方法。另外,在开发工具方面,本文选用VC++ 6.0。VC++ 6.0是Microsoft公司推出的Windows应用程序开发工具,因其具有界面友好,编程简便等优点而受到广泛的使用。在VC++ 6.0 版本中带有用于实现串行通信的MSComm控件。 在论文的最后部分,有一个程序实例。利用此程序实例,PC机可以通过串口接收到单片机发送的数据,以供PC机的进一步处理。本实例中,单片机采用MSC-51系列机型,PC机操作系统为WINDOWS XP,通信协议采用RS-232。 关键词:串行通信,单片机,控件 A Solution for Serial Communication between PC and Single-chip Microcontroller Based on VC++ Abstract This thesis introduces a designing way of serial communication software between personal computer and single-chip microcontroller using communication control in VC6.0,and gives the fundamental program of serial communication using RS-232 interface in a concrete instance. The serial communication between PC and single-chip microcontroller are widespread used in the field of Industrial Inspection or Industrial Control. Usually, as a lower position machine, the single-chip microcontroller collects data, while the personal computer, an upper position machine, processes the data together. They make data communications through the serial port. In Windows operating system, it has a lot of advantages, such as concise control interface, brief application program and so on, to use VC++ to develop the supervising software for the upper position machine. This thesis propo
显示全部
相似文档