基于C8051F單片機(jī)的USB HID類設(shè)備設(shè)計(jì)與實(shí)現(xiàn)
發(fā)布時(shí)間:2018-02-11 00:27
本文關(guān)鍵詞: USB 單片機(jī) HID 固件程序 前面板 出處:《中國(guó)地質(zhì)大學(xué)(北京)》2017年碩士論文 論文類型:學(xué)位論文
【摘要】:隨著計(jì)算機(jī)技術(shù)的發(fā)展,USB成為了計(jì)算機(jī)與外部設(shè)備連接普遍使用的標(biāo)準(zhǔn)。它最大的特點(diǎn)是速度快、易于使用、易于拓展、支持熱插拔,且很多操作系統(tǒng)對(duì)其提供了支持。隨著USB速率的不斷提高,穩(wěn)定性不斷地增強(qiáng),其用途將越來越廣。不僅是在非PC應(yīng)用領(lǐng)域,也將成為嵌入式領(lǐng)域的發(fā)展趨勢(shì)。USB接口技術(shù)將為PC主機(jī)和外設(shè)之間的數(shù)據(jù)傳輸提供更便捷的解決方案。論文分析了USB協(xié)議,研究了USB總線的系統(tǒng)拓?fù)浣Y(jié)構(gòu),闡述了USB主機(jī)和USB設(shè)備所實(shí)現(xiàn)的功能。介紹了USB的數(shù)據(jù)傳輸類型和USB通信協(xié)議,并對(duì)設(shè)備架構(gòu)進(jìn)行了解析,對(duì)設(shè)備狀態(tài)、描述符、標(biāo)準(zhǔn)請(qǐng)求及HID類設(shè)備等分別做了介紹。USB協(xié)議層是整個(gè)USB設(shè)備的核心單元,負(fù)責(zé)處理USB協(xié)議所規(guī)定的大部分內(nèi)容。根據(jù)USB2.0協(xié)議層體系結(jié)構(gòu),分析收發(fā)器和串行接口引擎在USB系統(tǒng)中實(shí)現(xiàn)的功能。除此之外,研究了UTMI協(xié)議以及USB微控制器芯片。在對(duì)USB協(xié)議體系結(jié)構(gòu)進(jìn)行詳細(xì)分析后,選用片上集成USB控制器的C8051F系列單片機(jī),設(shè)計(jì)一個(gè)USB HID類設(shè)備系統(tǒng),實(shí)現(xiàn)綜測(cè)儀主控與其前面板的數(shù)據(jù)通訊。在設(shè)計(jì)之前,對(duì)智能儀表的發(fā)展背景及計(jì)算機(jī)外總線的分類進(jìn)行了深入地討論。將USB總線與傳統(tǒng)儀表選用的GPIB總線和RS232總線等進(jìn)行對(duì)比,體現(xiàn)了USB總線極大的速度優(yōu)勢(shì)。進(jìn)行USB系統(tǒng)軟件設(shè)計(jì),包括設(shè)備固件程序和上位機(jī)端軟件。設(shè)備固件程序采用前后臺(tái)的設(shè)計(jì)理念,劃分為2個(gè)模塊:USB通用模塊和USB設(shè)備協(xié)議模塊。通用模塊實(shí)現(xiàn)設(shè)備的初始化、按鍵掃描及發(fā)送報(bào)表;協(xié)議模塊完成了中斷處理,及主機(jī)與HID設(shè)備之間命令的發(fā)送與應(yīng)答。上位機(jī)端軟件包括設(shè)備驅(qū)動(dòng)程序和客戶應(yīng)用程序。本文利用NI公司提供的NI-VISA驅(qū)動(dòng)軟件,針對(duì)此HID類設(shè)備生成一個(gè)適合Windows系統(tǒng)下的驅(qū)動(dòng)INF文件,并進(jìn)行安裝實(shí)現(xiàn)設(shè)備驅(qū)動(dòng)程序,以便主機(jī)能正確識(shí)別該設(shè)備?蛻魬(yīng)用程序是利用USBXpress開發(fā)包中的上位機(jī)動(dòng)態(tài)鏈接庫(kù)實(shí)現(xiàn)。USB系統(tǒng)設(shè)計(jì)完成后,利用BUS HOUND軟件抓取總線數(shù)據(jù)包,成功實(shí)現(xiàn)了USB數(shù)據(jù)通訊。
[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.
【學(xué)位授予單位】:中國(guó)地質(zhì)大學(xué)(北京)
【學(xué)位級(jí)別】:碩士
【學(xué)位授予年份】:2017
【分類號(hào)】:TP334.7
【相似文獻(xiàn)】
相關(guān)期刊論文 前10條
1 楊一波;孫浩;;基于USB HID的流水線監(jiān)測(cè)儀的研究[J];儀表技術(shù);2010年09期
2 卞廷波;王忠仁;;USB Mass Storage類的設(shè)備端固件開發(fā)[J];實(shí)驗(yàn)科學(xué)與技術(shù);2005年04期
3 倪陳強(qiáng);陳,
本文編號(hào):1501808
本文鏈接:http://sikaile.net/kejilunwen/jisuanjikexuelunwen/1501808.html
最近更新
教材專著