您好,欢迎来到佳博论文网!

串口通信设计与实现

论文编号:DZXX300 论文字数:18174,页数:70

摘要

当今社会是一个高度自动化的社会,各式各样的设备都可以和计算机联机,而最简单的自动化联机方式就是使用串行通信。串行通信存在的时间已经不短了,随着科技的发展,它不仅没有被取代,其应用范围反而越来越广。串行通信作为一种灵活、方便、可靠的通信方式,具有连接简单、传输距离长等优点,在工业监控、数据采集和实时控制系统中得到了广泛应用。这些应用中尤以字节通信最为常见。

本毕业设计的课题为“串口通信设计与实现”,主要是利用C++builder程序进行设计,计算机通过RS-232总线与液晶屏或波段开关控制器相连,液晶屏或波段开关再控制LED显示屏。计算机通过RS-232相连, 可储存、传输和显示3、4、8、16条等等不同的信息;实现串口设置和数据发送和接收.

关键词:串行通信,RS-232,C++builder ,LED显示屏

Abstract

Now the society is a high automated society, all kinds of equipment can link to the computer on-line, but the simple automated on-line way is to use serial communication. Serial communication existence time is already not short, along with the technical development, it not only has not been substituted, its application scope is more broadly. The serial communication take one kind nimble, convenient, reliable mailing address, has the connection simply, and the transmitting range is long and so on the merit. In the industry monitoring, the data acquisition and the real-time control system obtained the widespread application. In these applications is especially most common by the byte correspondence.

This graduation project topic is "the design and realization of data communication Serial communication ", it is designed by C++ Builder mainly . The computer is connected through the RS-232 main-line and the liquidcrystal screen, then the liquidcrystal screen or the range selector control the LED display monitor again. It is designed by C++Builder, compile the computer connect the singlechip with RS-232,and made it to storage, transmit and show 3、4、8、16 massages.So it is realized to send and accept the data.

Key words: Serial communication ,RS232 C++Builder,LED display monitor.

目录

摘要I

AbstractII

第1章 绪论1

1.1 系统开发背景1

1.2 任务或问题1

1.3 我的工作1

第2章 系统开发环境3

2.1 C++Builder简介3

2.2 C++Builder的环境模式3

第3 章 对串行通信及RS-232的认识5

3.1 串行通信简单认识5

3.1.1 同步串行通信方式5

3.1.2 异步串行通信方式5

3.2 串口通信6

3.3 串行通信接口标准7

3.3.1 什么是RS-232?7

3.3.2 RS-232接口定义及连线7

3.3.3 RS-485接口标准9

3.4握手10

3.4.1软件握手10

3.4.2 硬件握手11

3.4.3 XModem握手11

第4章 用C++Builder进行程序编写13

4.1 串行通信的Windows API简述13

4.1.1串行通信相关函数13

4.1.2使用流程14

4.1.3检查资源设置15

4.2 MSComm控件17

4.2.1 MSComm控件处理问题的方法17

4.2.2 MSComm控件的常用属性和事件17

第5章 系统分析与设计19

5.1 系统传输图示19

5.2 系统设计整体流程分析19

5.3 初始化20

5.4 发送字符串21

5.5读取字符串22

第6章 程序基本功能的实现与介绍24

6.1 程序的主要功能24

6.2 程序的实现24

6.3 上位机运行结果29

6.4 下位机程序设计30

6.5 LED显示屏与控制器系统实现30

第7章 毕业设计总结33

致谢34

参考文献35

附录1 上位机主要程序代码36

附录2 下位机主要程序代码61

串口通信设计与实现......