当前位置:主页 > 科技论文 > 计算机论文 >

基于C8051F单片机的USB HID类设备设计与实现

发布时间:2018-02-11 00:27

  本文关键词: USB 单片机 HID 固件程序 前面板 出处:《中国地质大学(北京)》2017年硕士论文 论文类型:学位论文


【摘要】:随着计算机技术的发展,USB成为了计算机与外部设备连接普遍使用的标准。它最大的特点是速度快、易于使用、易于拓展、支持热插拔,且很多操作系统对其提供了支持。随着USB速率的不断提高,稳定性不断地增强,其用途将越来越广。不仅是在非PC应用领域,也将成为嵌入式领域的发展趋势。USB接口技术将为PC主机和外设之间的数据传输提供更便捷的解决方案。论文分析了USB协议,研究了USB总线的系统拓扑结构,阐述了USB主机和USB设备所实现的功能。介绍了USB的数据传输类型和USB通信协议,并对设备架构进行了解析,对设备状态、描述符、标准请求及HID类设备等分别做了介绍。USB协议层是整个USB设备的核心单元,负责处理USB协议所规定的大部分内容。根据USB2.0协议层体系结构,分析收发器和串行接口引擎在USB系统中实现的功能。除此之外,研究了UTMI协议以及USB微控制器芯片。在对USB协议体系结构进行详细分析后,选用片上集成USB控制器的C8051F系列单片机,设计一个USB HID类设备系统,实现综测仪主控与其前面板的数据通讯。在设计之前,对智能仪表的发展背景及计算机外总线的分类进行了深入地讨论。将USB总线与传统仪表选用的GPIB总线和RS232总线等进行对比,体现了USB总线极大的速度优势。进行USB系统软件设计,包括设备固件程序和上位机端软件。设备固件程序采用前后台的设计理念,划分为2个模块:USB通用模块和USB设备协议模块。通用模块实现设备的初始化、按键扫描及发送报表;协议模块完成了中断处理,及主机与HID设备之间命令的发送与应答。上位机端软件包括设备驱动程序和客户应用程序。本文利用NI公司提供的NI-VISA驱动软件,针对此HID类设备生成一个适合Windows系统下的驱动INF文件,并进行安装实现设备驱动程序,以便主机能正确识别该设备。客户应用程序是利用USBXpress开发包中的上位机动态链接库实现。USB系统设计完成后,利用BUS HOUND软件抓取总线数据包,成功实现了USB数据通讯。
[Abstract]:With the development of computer technology, USB has become the universal standard for connecting computers to external devices. Its greatest characteristics are high speed, easy to use, easy to expand, support for hot swapping, And many operating systems support it. With the increasing speed and stability of USB, it will be used more and more widely, not only in non-PC applications, but also in non-PC applications. USB interface technology will provide a more convenient solution for data transmission between PC host and peripheral devices. This paper analyzes USB protocol and studies the system topology of USB bus. In this paper, the functions of USB host and USB device are described, the data transmission type and USB communication protocol of USB are introduced, and the structure of the device is analyzed. The HID protocol layer is the core unit of the whole USB device, which is responsible for handling most of the contents stipulated by the USB protocol. The functions of transceiver and serial interface engine in USB system are analyzed. In addition, the UTMI protocol and USB microcontroller chip are studied. After the detailed analysis of USB protocol architecture, A USB HID type equipment system is designed by using C8051F series single-chip microcontroller integrated with USB controller on a chip to realize the data communication between the master control and the front panel of the comprehensive measuring instrument. Before the design, the data communication between the main controller and its front panel is realized. The development background of intelligent instrument and the classification of computer external bus are discussed in depth. The USB bus is compared with the GPIB bus and RS232 bus of traditional instrument. The USB system software is designed, including the firmware program of the equipment and the software of the upper computer. The firmware program of the device adopts the design idea of the front and back. It is divided into two modules: USB general module and USB device protocol module. The general module realizes the initialization of the device, the keystroke scanning and sending report, the protocol module completes the interrupt processing, The software of upper computer includes device driver and customer application program. This paper uses NI-VISA driver software provided by NI Company. For this HID class device, a driver INF file suitable for the Windows system is generated, and the device driver is installed and implemented. The client application program uses the host computer dynamic link library in the USBXpress development kit to realize the design of .USB system, and grabs the bus data packet by using the BUS HOUND software, and realizes the USB data communication successfully.
【学位授予单位】:中国地质大学(北京)
【学位级别】:硕士
【学位授予年份】:2017
【分类号】:TP334.7

【相似文献】

相关期刊论文 前10条

1 杨一波;孙浩;;基于USB HID的流水线监测仪的研究[J];仪表技术;2010年09期

2 卞廷波;王忠仁;;USB Mass Storage类的设备端固件开发[J];实验科学与技术;2005年04期

3 倪陈强;陈,

本文编号:1501808


资料下载
论文发表

本文链接:https://www.wllwen.com/kejilunwen/jisuanjikexuelunwen/1501808.html


Copyright(c)文论论文网All Rights Reserved | 网站地图 |

版权申明:资料由用户432ef***提供,本站仅收录摘要或目录,作者需要删除请E-mail邮箱bigeng88@qq.com