文档详情

基于单片机光电传感器硬件设计.doc

发布:2018-06-04约1.85万字共35页下载文档
文本预览下载声明
大连海事大学 毕 业 论 文      年 月 基于430单片机光电传感器硬件设计 专业班级: 通信工程3班 姓 名: 指导教师: 信息科学技术学院 摘 要 光电编码器是一种高精度位置控制系统常用的位移检测传感器,以高精度计量光栅作为检测元件,将输入的角位置信息通过光电转换转化成相应的数字代码。其分辨率高、测量范围广、精度高、使用可靠、易于维护、结构简单等优点,具有很高的性价比,已普遍应用雷达、光电经纬仪、精密测角装置、机器人、数控机床以及高精度闭环调速系统中,是自动化设备中非常理想的角度传感器。 本文以光电传感器为背景,在硬件电路上实现MSP430单片机与计算机进行半双工数据通信。根据传送数据速度快,准确度高,距离远等要求,本文采用了RS485协议进行数据通信,并且能通过计算机上读出从单片机接收的数据。 首先,光电传感器获得的数据传入单片机中,单片机对数据进行处理后,遵从预先规定好的波特率、奇偶校验有无、数据位数、停止位数等通信协议将数据按位经MAX485芯片转换为485协议电平进行传输。在计算机接收前端配置485电平转232电平接头将传输来的485电平转换为计算机中能识别的232电平,实现数据的接收。 本文在Protel DXP软件中设计电路图,借助Emberdded Workbench软件进行电路调试,在硬件电路上实现了单片机与计算机的半双工通信。 关键词:光电传感器;430单片机;数据通信 ABSTRACT The optical encoder is a high precision position control system of the displacement detection sensor used in high-precision measurement grating as a detecting element, the angular position of the input information through the photoelectric converter into corresponding digital code. Its high resolution, wide measurement range, high accuracy, reliable, easy to maintain, simple structure, etc., with a high cost, has been widely used radar, optical theodolite, precise angle measurement devices, robots, CNC machine tools and high-precision closed-loop speed control systems, automation equipment is ideal angle sensor. Based on the photoelectric sensor as the background, the hardware circuit is MSP430 half-duplex data communication with computers. According to transmission speed, high accuracy, distance etc requirements, this paper adopted RS485 protocol in data communications, and will be read from the microcontroller receives the data on the computer. First of all, the photoelectric sensor data into single chip microcomputer, the microcontroller for data processing, to comply with prescribed with or without good baud rate, parity, data bits. Stop bits according to bit the MAX485 communication protocols, such as data is converted to 485 transmission protocol level. Turn 485 level in the computer receives configuration will transfer to the 48
显示全部
相似文档