南京邮电大学毕业设计(论文)题目PC机与单片机间串口通信技术的实现专业广播电视工程学生姓名侯文元班级学号B11011322指导教师梅中辉指导单位通信与信息工程学院日期: 2014年 11月 17 日至 2015年 6月 12日毕业设计(论文)原创性声明本人郑重声明:所提交的毕业设计(论文),是本人在导师指导下,独立进行研究工作所取得的成果。
除文中已注明引用的内容外,本毕业设计(论文)不包含任何其他个人或集体已经发表或撰写过的作品成果。
对本研究做出过重要贡献的个人和集体,均已在文中以明确方式标明并表示了谢意。
论文作者签名:日期:年月日摘要本次毕业设计的课题是PC机与单片机间串口通信技术的实现,本次毕设的主要内容是熟悉单片机的工作原理,RS232串行通信工作原理,以及PC机与单片机间的串行工作方式,并掌握Keil软件的使用以及下载程序到单片机的方法。
本篇论文共分五章,第一章是绪论,主要介绍了课题的研究背景、意义以及研究现状。
第二章主要是对单片机及其控制系统的概述,介绍了单片机的组成以及单片机应用系统的开发过程。
第三章是单片机串行通信概述,首先介绍了串行通信和并行通信的区别以及串行通信的两种方式,然后简略介绍了下串行通信的几种接口标准,接着详细介绍了单片机中的串行口,包括它的结构与控制、工作方式、波特率计算和串行口初始化,最后介绍了串行通信控件MSComm。
第四章主要讲了串行口方式1的的编程与实现,完成了两个实例,第一个是单片机与PC 机间发送单个字符,第二个是实现了串口打印功能。
第五章是一个综合的大程序,利用了VC中的MSCOMM控件,实现了通过单片机与PC机间的串口通信来显示环境温度。
本次毕设的成果是一篇论文以及实物展示,通过三个实例来展示串口通信技术,所用单片机是51单片机。
关键词:串口通信; RS232串行通信; MSComm; 51单片机;串行工作方式;ABSTRACTThe graduation design topic is between PC and MCU serial communication technology of the implementation, the main contents of the complete set is familiar with the working principle of single-chip, RS232 serial communication principle, and between PC and MCU serial working mode and master keil software use and download the program to the microcontroller method.This paper is divided into four chapters. The first chapter is the overview of SCM and its control system, and the composition of SCM and the development of SCM application system.The second chapter is the overview of single-chip serial communication. Firstly, the paper introduces the serial communication and parallel communication and serial communication two way, then briefly introduces the serial communication under the several kinds of interface standard, then introduces the microcontroller serial port, including its structure and control, working mode and baud rate calculation and serial port initialization. At last, it introduces the serial communication MSComm control. The third chapter mainly talks about the programming and Realization of serial port 1. The first one is single character between single chip computer and PC machine, and the second is the serial print function.. The fourth chapter is a comprehensive program, using the MSCOMM VC control, and through the microcontroller with the serial communication between the PC to show the environment temperature.The completion of the results is a paper and physical display, through three examples of serial communication technology, microcontroller is 51 microcontroller.Key words:Serial communication;RS232 serial communication;MSComm;51 SCM;Serial working mode目录第一章绪论 (1)1.1选题背景 (1)1.2研究的意义及目的 (1)1.3本选题的研究状况及发展趋势 (1)第二章单片机及控制系统概述 (3)2.1单片机概述 (3)2.1.1单片机的组成 (3)2.1.2单片机的分类和指标 (4)2.2单片机控制系统的组成 (5)2.2.1 单片机控制系统的硬件组成 (5)2.2.2 单片机控制系统的软件组成 (7)2.3单片机应用系统的开发过程 (8)第三章串行口通信原理 (12)3.1串行通信的基本概念 (12)3.1.1并行通信与串行通信 (12)3.1.2串行通信工作模式 (13)3.1.3串行通信的错误校验 (13)3.2串行通信的接口标准 (14)3.3单片机中的串行口 (15)3.4串行通信控件MSComm (17)第四章串行口方式1的编程与实现 (19)4.1单片机与PC机间发送单个字符 (20)4.2串行口打印在调试程序中的应用 (22)第五章 VC(MSCOMM控件)与单片机通信实现温度显示 (28)结束语 (34)致谢 (35)参考文献 (36)附录A (37)第一章绪论1.1选题背景随着电子技术的不断发展,单片机的应用范围越来越广泛,在工业控制、家电控制、数据采集等多个领域都有着十分重要的作用,由于单片机的使用,越来越多的系统开始向智能化方向发展。