资源预览内容
第1页 / 共26页
第2页 / 共26页
第3页 / 共26页
第4页 / 共26页
第5页 / 共26页
第6页 / 共26页
第7页 / 共26页
第8页 / 共26页
第9页 / 共26页
第10页 / 共26页
亲,该文档总共26页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
*大大 学学本本 科科 毕毕 业业 论论 文文科科 目:单片机串行通信协议设计目:单片机串行通信协议设计学学 院:工学院院:工学院专专 业:通信工程业:通信工程年年 级:级:20092009 级级姓姓 名:名:*指导老师:指导老师:*I摘摘 要要本文介绍了 89C51 单片机的发展历史和简单介绍,并展望了它们的前景。着重介绍了单片机串行接口技术,指出了它们的重要性并阐述了其实现原理。根据串行通讯原理结合 RS232 串口设计了串行通讯协议,利用汇编语言为基础,编写了一个基于 RS232 串口的通信程序,实现了单片机-PC 机的双机通讯。在硬件上测试完好,测试表明,在基于设计的通信协议上的单片机-PC 机的通讯状况良好。关键词:关键词:89C51 单片机;串行通讯原理;RS232 串口;串行通讯协议IIAbstractThis article describes the development and give a brief history of the 89C51 microcontroller and look forward to their future.Focused on single-chip serial interface technology, pointed out the importance of them and described the principles of its realization. Serial communication in accordance with the principle of combining the design of a serial RS232 serial Communication protocol, Based on the use of assembly language, the preparation of a RS232 serial communication based on the procedures, to achieve a single-chip dual-PC machine communication. Well-tested in hardware, testing showed that the single-chip-PC communications machine based on the design of communication protocols in good condition.Key words:89C51 microcontroller,;principle of serial communication,;RS232 serial port,;serial communication protocolIII目目 录录摘 要.I Abstract .II 目 录.III 绪 论.1 1.单片机概述.2 1.1 单片机的发展历史.2 1.2 单片机的特点.3 1.3 单片机的应用.3 14 AT89C51 单片机简介.5 2.单片机的串行接口.11 2.1 基本概念.11 2.2 串行口和控制寄存器.12 3.串行通讯技术及硬件基本组成.15 3.1 硬件的基本组成.15 3.2 串行通信原理.15 3.3 双机通信连接方法.16 4.软件的设计和调整过程.17 4.1 程序流程图.17 4.2 通信协议.18 4.2.1 串行口控制寄存器 SCON 的设置.18 4.2.2 定时器的初始化设置.18 4.2.3 波特率计算.19 4.3 程序演示.19 总 结.20 参考文献.21 致 谢.221绪绪 论论在工业监测及自动控制系统种,串行通信是微机与单片机之间进行数据交换的主要方式。而在现代社会中,短距离的双机通信,最常用的就是串口通信。目前存在的一些通信协议(如 RS-232,RS-484 等) ,仅对通信线路的电气特性进行了约定,并没有涉及通信内容的格式,类型等信息。针对这一现象,我对于RS-232 接口设计了比较规范的串行通信协议,实现了上位单片机与下位计算机的串行通信。通过实验室测试表明该串行通信协议是可靠可行的。单片微型计算机是微型计算机发展中的一个重要分支,是把构成一台微
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号