单片机串行通信功能设计论文
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
XX化工学院
本科毕业论文
题目:单片机串行通信功能设计
摘要
现代的单片机测控系统中通常以PC机作为控制中心,单片机将采集到的数据通过串口送给PC机进行各种处理,为保证数据传送的及时性和正确性,就必须建立可靠的通讯。在开发控制系统时,信号的测控及采集均由单片机系统自行完成,然后通过异步串行通信口将信号实时地传送给PC机进行处理。上位PC机使用VB进行串口通信的编程,下位单片机使用C51进行编程。本文详述了使用VB和C51实现PC机和单片机串行通信的开发方法,并简要地介绍了VB通讯
控件及其使用方法,给出了调试程序。
采用将置于现场MCS一51单片机应用系统挂在主机PC的串行通信上,通过串行通信电路及系统控制软件与PC机和单片机进行数据交换的方式,实现了对现场数据的接收与发送。串行通信系统主机采用标准接口。该系统的通信是由PC机主动进行发信访问,各个MCS 一51单片机处于被动通信状态,对PC机与单片机数据通信的校验采用奇校验方式。
关键词: 单片机;串行通信;VB程序设计; 上位机
Abstract
Modern microcontroller measure-control system usually regard PC as the control center, the microcontroller will send the collected data to a PC for a serial port, to ensure that the transmission of all the timeliness and accuracy data, It must establish reliable munication.In the development of the control system, signal control and collection of microputer system itself, then through asynchronous serial munication to the real-time signal transmitted PC.PC using VB programming for serial munication, SCM C51 use for programming.The paper describes using VB C51 and PC machine and MCU development method of serial munication, and briefly introduces the method of using VB munication control is presented, and debugging. Using placed on site MCS a 51 SCM system in the PC host hanging on the serial munication, through serial munication circuit and control system software and PC and MCU exchange data on site, receiving and sending data.Serial munication system is using standard interface host.The system of munication by the PC is active on a visit each MCS kindhearted passive munication 51-series microputer.For PC and calibration adopts single-chip data munication's parity.
Keywords:Single Chip; Serial munication; VB program design; Host puter
目录第一章绪论1
1.1单片机技术介绍1
1.2课题背景与意义2
1.3课题研究内容3
第二章串行通信基础4
2.1串行通信协议4
2.2通信方式5
2.2.1串行通信5
2.2.2并行通信6
2.3串行通信方式7
2.3.1异步串行通信方式7
2.3.2同步串行通信方式8
2.4串行通信的制式9
2.4.1单工9
2.4.2半双工9
2.4.3全双工9
2.5波特率10
2.6串行通信的错误校验11
2.6.1奇偶校验11
2.6.2代码和校验11
2.6.3循环冗余校验11
2.7串行通信的工作方式11
2.7.1 方式011
2.7.2 方式113
2.7.3 方式2和方式314
2.8本章小结15
第三章系统开发基础16
3.1系统硬件16
3.1.1 微处理器芯片89C5116
3.1.2 显示芯片HD7279A17
3.1.3 串行通信芯MAX23218
3.2软件工具及编程语言20
3.2.1选用VB开发上位机软件20
3.2.2 MSm 控件的主要属性、事件20
3.2.3编程小结21
3.3系统方案设计21
第四章系统方案实施23
4.1接口设计23
4.1.1 系统连接电路23
4.1.2串行通信电路24
4.2软件设计25
4.2.1显示HD7279显示程序25
4.2.2串行口通信26
4.2.3 VB通信程序28
4.3小结29
第五章结束语30
致谢31
参考文献32