1、 毕业设计(论文) 题 目 单片机与 PC 之间的串行通讯 系 (院) 计算机科学技术系 专 业 通信工程 班 级 学生姓名 学 号 指导教师 职 称 讲师 二一二年五月二十日 I 单片机与 PC 之间的串行通讯 摘 要 随着计算机技术的发展,特别是单片机技术的迅猛发展,单片机被 广泛应用于大量工业控制系统。单片机拥有占有空间小,价格低廉,开 发应用程序容易的优势,可用于恶劣的工业环境中,单片机的数据采集 和现场控制能力被广泛应用于分布式控制系统中。但因为单片机的计算 能力是有限的,而且用它也很难进行复杂的数据处理,因此这就要求我 们往往在具有繁多功能的控制系统中采用上,下位机系统,单片机被使
2、 用为下位机系统采集数据和控制设备,而使用 PC 机为上位机系统处理 复杂数据和控制单片机。当今,在大量解决通信系统通信受阻的常用方 案中, 通过 PC 机自带的 RS-232 串行通讯端口与外设实现通讯这一方案 备受人们的青睐。故由上知,实现单片机与 PC 机之间的串行通讯具有 重要的意义。 本论文设计详细介绍了使单片机与 PC 机之间能够进行串行通讯的 软件和硬件的实现。在硬件设计中,通过 RS-232 串行通讯端口将单片 机与 PC 机相互连接,PC 机把数据传输至单片机系统,单片机系统会将 这一传输数据显示在 LED数码管上; 在软件设计中, 利用 Visual Basic6.0 中的
3、 MSComm 串行通讯控件来编写 PC 机的串口通讯程序。 在对此设计 正确测试后, 证明我们的设计能够实现单片机与 PC 机之间的串行通讯。 关键词:单片机;串行通讯;RS-232;Visual Basic6.0;MsComm II Serial Communication between SCM and PC Abstract With the development of computer technology, especially the rapid development of the SCM technology, SCM has been widely used in ind
4、ustrial control systems. The SCM has the advantage of possession of a small space, low price, easy to develop applications that can be used in harsh industrial environments, data acquisition and site control capabilities of the microcontroller is widely used in distributed control systems. Single-ch
5、ip computing power is limited, and it is difficult to use it for complex data processing, so this is often used in the control system has a range of functions, the controller system, the microcontroller is used for the next bit machine system data acquisition and control equipment, using a PC as the
6、 host computer system to handle complex data and control SCM. Today, a large number of commonly used programs address communication system communication disruption, comes via a RS-232 serial communication interface with peripherals, communication of this program much people of all ages. Therefore, by the Sounds, the communication between the SCM and PC has an important significance. The design details of this paper between the SCM and PC serial communications software and hardware im