文档介绍:河南农业大学
本科生毕业论文(设计)
题目单片机与PC机串行通信系统软件设计
学院机电工程学院
专业班级电子信息工程07级3班
学生姓名王卫亮
指导教师胡建东
撰写日期:2011年 5 月 18日
摘要
随着计算机技术尤其是单片微型机技术的发展,单片机被广泛应用在工业控制系统中。单片机具有体积小、价格低廉、开发应用方便、可应用于恶劣工业环境的特点,在分布式控制系统中多采用单片机进行数据采集和现场控制。由于单片机的计算能力有限,难以进行复杂的数据处理,因此在功能复杂的控制系统中常采上位机下位机系统,单片机用作下位机进行数据采集和设备控制,而PC机用做上位机进行复杂的数据处理和对单片机的控制。因此如何实现PC机与单片机之间的通信具有重要的现实意义。
仿真技术的发展为电子系统设计提供了一种新的开发方法,经过软件仿真和硬件仿真,不仅缩短了开发周期、降低开发成本,而且提高了系统设计的成功率。文章介绍了一种利用单片机全双工串行口实现与PC机串行通信的软件设计方法,并利用仿真软件Protues进行软件模拟测试。通过对仿真结果的分析,软件基本实现各项通信指标,在实际的通信系统中可以加以利用。
关键词:单片机;串行通信;仿真;Protues
Software design of a munication system between MCU and puter
Abstract
Along with the development puter, especially the technology of MCU, MCU are widely used in the system of industry control. Small size, low price, the convenience of development and application and high adaptability are its peculiarities, respectively. It is usually used in distributed system to collect data and control on the scene. Owing to the limit of calculation, it is difficult to plex data. Therefore, PC lower puter system is often applied in plex system. MCU collects data and control equipments as downside machine, while PC plex data processing and the control of MCU. So how to realize munication between PC and MCU is practically meaningful.
The simulation technology provides a new way to develop for circuit system. Not only the period of development has been shortened and the developing cost has been decreased, but also the rate of ess for this system has been improved. The thesis introduces a new method of software design by full-duplex serial port of MCU, as well as, the software simulation was validated by Protues, a famous simulation software. For what the results have been analyzed, the software we designed can realize the features used in munication system. So it can be used in munication system.
Key Words: MCU; munication; simulation; Protues
目录
1 引言 1
2 串口通信基础理论 2
两种常用接口方式 2
并行接口 2
串行接口 2
RS-232串行接口标准 2
串行通信基本原理 3
3