基于RS-485通信的主从式激光器控制系统的设计【毕业论文】.doc
文本预览下载声明
本科毕业设计
(20 届)
基于RS-485通信的主从式激光器控制系统的设计
所在学院
专业班级 电气工程及其自动化
学生姓名 学号
指导教师 职称
完成日期 年 月 摘 要
【摘要】本文研究的是基于RS-485总线通信的主从式激光器远程控制系统,核心工作是实现上位机(控制器)与下位机之间的远程通信。系统采用上位机控制、下位机应答的主从式控制方案,通过自定义串行通信协议,实现了上位机与多个单片机系统的交互式通信及控制的功能,通信波特率为9600bps。系统可同时连接128个下位机,每个下位机可支持214种操作,每种操作均由控制器上唯一的按键进行控制。系统中每个下位机被赋予唯一的本机地址(ID),当且仅当接收到符合自己ID的数据信息时才予以应答,控制激光器模拟器件动作,具体表现为:控制相应通道的LED点亮、将该下位机地址信息回发至上位机。本系统设计成本低、稳定性好、实时性强,具有可扩展性、很好的实际应用价值。
【关键词】单片机;RS-485差分总线;通信协议;主从式结构。
Abstract
【ABSTRACT】This study is based on the RS-485 bus communication master-slave remote control system of lasers, the core work is to achieve the remote communication between host computer (controller) and lower machines. The system adopted the master-slave control scheme of host machine polls and lower machines answer. Through a custom serial communication protocol, to achieve the interactive communication and control functions between controller and multiple singlechips systems, communications baud rate is 9600bps. The number of 128 lower machines can be connected to the system at the same time, and each lower machine can support 214 species operations, each operation are controlled by the only button on the controller. Every lower computer is assigned a unique address number (ID), the next crew response signal was given only if the received ID of the command with his own ID, while the laser analog actions, specific performance: control the LED light, the lower machine address information back to controller. The system is low cost, good stability, real strong, scalability and good practical value.
【KEYWORDS】Singlechip;RS-485 differential bus;Communication protocol;aster-slave structure.
目 录
1 引言 1
1.1 选题的背景和意义 1
1.2 本文内容简介 1
2 系统设计方案的选择 3
2.1 通信方案的选择 3
2.2 上位机 3
2.3 下位机 4
2.4 电源 4
2.5 系统总体设计框图 4
3 系统硬件设计 6
3.1 电源电路 6
3.2 上位机 6
3.2.1 按键模块 6
3.2.2 单片机主控模块 7
3.2.3 TTL电平转RS-485电平模块 8
3.2.4 上位机工作原理 9
3.3 下位机 9
4 系统软件设
显示全部