嵌入式系统中USB主口的开发
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
USB接口具有使用方便,数据传输率高,支持即插即用等特点。但由于USB接口协议复杂,涉及的方面广,特别是软件种类多,USB芯片种类繁多,使得USB设备的开发十分困难。然而随着USB应用领域的逐渐扩大,人们对于USB的期望也越来越高,希望USB能应用在各种计算机领域中,尤其是能应用在移动数据领域中,能通过一些移动设备直接和USB外设通信,使USB能应用在没有PC的领域中。如何将USB应用到嵌入式领域,实现USB的点对点通讯,成为目前USB研究领域的热点。
     本论文以实现任意波发生器具有USB主口的功能为目的,以ADS1.2/Embest为软件开发环境,采用Hynix的HMS30C7202作为主控芯片,采用Cypress的SL811HS作为USB控制芯片。
     (1)研究分析了USB1.1协议;在研究USB体系结构、USB总线的拓扑结构、USB总线的物理接口、USB系统的逻辑分层和USB总线数据通信流等基本内容的基础上,重点对USB1.1协议层进行了分析研究。
     (2)系统地分析了嵌入式系统的开发流程,研究设计了任意波发生器中USB主口设计的硬件系统。分析了干扰因素,并从元器件的选择、对外部电磁辐射进行屏蔽、晶振电路稳定性和PCB板这四个方面,分别采取了抗干扰措施,保证了系统稳定可靠的运行。
     (3)进行了系统软件设计,研究分析了Bulk-Only传输协议、SCSI命令集和FAT文件系统的构建。该系统完成了USB主机控制器驱动程序、核心驱动程序以及用户软件的设计,实现了设备的枚举、配置等功能;系统支持Mass Storage类协议,建立了与文件系统的接口,通过发送SCSI命令实现了U盘文件的读取。
     论文研究开发了嵌入式系统中USB主口,实现了嵌入式USB主机系统的构建,在任意波发生器的控制面板上增加USB主机的功能,实现了对存储在U盘里的波形数据进行处理。对于开发嵌入式USB主机,使USB的应用脱离PC机具有重要意义和实用推广价值。
USB interface has a variety of features, such as easy to use, high data transmission rate and supporting plug-and-play. However, due to the complexity in USB interface protocol, involving a wide area, especially many sorts in software, a wide range of USB chip, which makes it very difficult in the development of USB devices. However, with gradual expanse in the application areas of USB, people's expectation for USB is also getting higher and higher. It is hoped that USB be used in various fields of computers, in particular in the field of mobile data, in which USB can be applied in the field with the absence of the PC through direct communication with USB devices. How to apply USB in the field of embedded field and achieve peer-to-peer communications of has become a hot research field.
     In this paper, we consider it as the purpose to realize that arbitrary wave generator has the function of USB host mode. Besides, we choose ADS1.2/Embest as software development environment, use chip HMS30C7202 as controller chip and select Cypress's SL811HS as USB controller chip.
     (1) We analyzed USB1.1 agreement, conducted analysis mainly on USB1.1 agreement on the basis of the research of the architecture of USB, USB bus topology, USB bus physical interface, logic tiers of USB system, data communications flow of USB bus and other basic elements.
     (2) We conducted systematic analysis of the development process of embedded system, and designed the USB host mode hardware system of arbitrary wave generator. We analyzed interference factors, and took anti-jamming measures separately on the choice of components, shielding the external electromagnetic radiation, crystal stability and PCB circuit boards to guarantee reliable operation of system.
     (3) We conducted system software design, did research and analysis of the Bulk-Only transfer protocol, SCSI command sets and construction of FAT file system. The system completed design on USB host controller driver program, core driver program and user software, and realized functions of the enumeration of the equipment, configuration, and other functions. System supported Mass Storage class agreement, established a file system interface and achieved reading of USB document through sending SCSI orders.
     The paper did research and development on of USB host mode in embedded system, realized the construction of embedded USB host system, added USB host functions in the control panel of arbitrary wave generator and achieved processing to the waveform data stored in the U-disk, which is of great significance for the promotion and practical value on the development of embedded USB host and making the application of USB absent form PC.
引文
[1] 中国计算机报.设备插架将简化 PC 机外围设备扩充作业[EB/OL].http: //media.ccidnet.com /media/ciw/742/a2301.htm.
    [2] 萧世文.USB 2.0 硬件设计[M].北京:清华大学出版社,2002: 1-3.
    [3] 刘金凤.基于 USB 的便携式数据存储系统[D]. 哈尔滨:东北农业大学,2004.6.
    [4] 何广军.USB 接口在串行通信中的应用.电子技术应用.2002 年,第 7 期:58-60.
    [5] 胡小军,季军杰.通用串口总线(USB)性能特点及其应用.微机发展.2001 年,第 3 期:25-27.
    [6] 谢瑞和.串行技术大全[M].北京:清华大学出版社,2003.4.
    [7] 徐成玉.基于 ARM 的 USB 主机系统设计研究[D].哈尔滨:哈尔滨工程大学,2007.1.
    [8] 黄维柱,许军.通用串行总线 USB.计算机应用研究.2001 年,第 2 期:46-48.
    [9] 李嘉伶.通用串行总线 USB.电子技术.2000 年,第 3 期:59-60.
    [10] [USB 之家]USB 优点.www.usbfans.com/zs/2.htm.
    [11] 武安河.Windows 20 00/XP WDM 设备驱动程序开发[M].北京:电子工业出版社,2003:284-325.
    [12] 吕京建,肖海桥.面向二十一世纪的嵌入式系统综述.http://www.bol-system.com.
    [13] 陈启美,丁传锁,计算机 USB 接口技术[D].南京:南京大学出版社,2003.
    [14] Civet.全面认识 USB 技术(一)[J].微型计算机,2000.8.
    [15] Civet.全面认识 USB 技术(二)[J].微型计算机,2000.8.
    [16] JanAxelson.USB 大全(陈逸等)[M].中国电力出版社,2001.5.
    [17] 廖济林.USB2.0 应用系统开发实例精讲[M].北京:电子工业出版社,2006.
    [18] 张慧娟.一种具有 USB 功能的农田数据采集系统[D].北京:中国农业大学,2007.5.
    [19] 嵌 入 式 系 统 在 国 内 外 的 发 展 [S].http://blog.163.com/dingyuanabc@126/blog/static/513 818222007102444053823/
    [20] 马学文,朱名日,程小辉.嵌入式设备中 USB 接口的硬件设计.桂林工业学院学报,2004.02:245-247.
    [21] 周立功.PDIUSBDIZ USB 固件编程与驱动开发[M].北京航空航天大学出版社,2003.2.
    [22] 马伟.计算机 USB 系统原理及其主/从机设计[M].北京航空航天大学出版社,2004.1.
    [23] Compaq Computer Corporation, Intel Corporation, Microsoft Corporation, NEC Corporation.Universal Serial Bus Specification (Revision1.1)[S].http://www.usbfans. com/js/3.htm.1998.9.
    [24] 什么是 Concentrator 集中器[S].http://blog.ixpub.net/html/32/10181132-54665.html
    [25] Dan Harmon.哪种 USB 接口适用于您的应用?(上)[J].2008.2:141-145.
    [26] 许永和.8051 单片机 USB 接口程序设计(上)[M].北京:北京航空航天大学出版社,2004:10,12-15,48-71.
    [27] 张念潍等.USB 总线接口开发指南[M].北京:国防工业出版社,2001.
    [28] 高有唐,常进.PD IUSBD12 芯片在 USB 接口电路中的应用[J].现代电子技术,2003.9:92-94.
    [29] 张永生,谭成翔,汪海航.基于 Linux 的主机间 USB 通信的实现[J].计算机应用研究.2007.8:306-308.
    [30] [0]黄官立.基于 Intel Xscale 的 USB2.0 Mass Storage 类高速设备实现与研究[D].南京:东南大学,2006.3.
    [31] Don Anderson.USB 系统体系[M].北京:中国电力出版社,2001:34-37.
    [32] 车晓萍.基于 Windows CE.net 嵌入式软件开发平台的研究[D].西安:西北大学,2006.5.
    [33] 姚放吾.嵌入式系统的硬件/软件协同设计[J].微计算机信息,2001.3:1-3.
    [34] 田泽.嵌入式系统开发与应用教程[M].北京:北京航空航天大学出版社.2005.3.
    [35] 蔡建平.关于嵌入式应用开发技术.单片机与嵌入式系统应用,2001.3.
    [36] 周立功.ARM 嵌入式系统实验教程(一)[M].北京:北京航空航天大学出版社,2005.10.
    [37] 胡大可.基于单片机 8051 的嵌入式开发指南[M].北京:电子工业出版社,2003.1.
    [38] 沈连丰.嵌入式系统及其开发应用[M].北京:电子工业出版社,2005.7.
    [39] 周立功.ARM 嵌入式系统实验教程(二)[M].北京:北京航空航天大学出版社,2005.10.
    [40] 孙红波.ARM 与嵌入式技术[M].北京:电子工业出版社,2006.3.
    [41] 周立功.ARM 嵌入式系统实验教程(三)[M].北京:北京航空航天大学出版社,2005.10.
    [42] 陈文智.嵌入式系统开发原理与实践[M].北京:清华大学出版社,2005.8.
    [43] 符意德.嵌入式系统设计原理及应用[M].北京:清华大学出版社,2004.11.
    [44] 陈赜.嵌入式教学实验(基础实验篇)教程[M].武汉:华中科技大学,2003.10.
    [45] 王田苗.嵌入式系统设计与实例开发[M].北京:清华大学出版社,2003.10.
    [46] 韩寿丽.基于 ARM 的嵌入式智能仪表研究. [D]北京:中国农业大学,2007.6.
    [47] 田泽.ARM7 嵌入式开发实验与实践[M].北京:北京航空航天大学出版社,2006.9.
    [48] 田泽.嵌入式系统开发与应用实验教程(第 2 版)[M]. 北京:北京航空航天大学出版社,2005.4.
    [49] 张晓林.嵌入式系统设计与实践[M].北京:北京航空航天大学出版社,2006.1.
    [50] 于明.ARM9 嵌入式系统设计与开发教程[M].北京:电子工业出版社,2006.4.
    [51] 王田苗.嵌入式系统设计与实例开发[M].北京:清华大学出版社,2003.10.
    [52] 李驹光.ARM 应用系统开发详解[M].北京:清华大学出版社,2003.12.
    [53] 康华光.电子技术基础模拟部分(第四版)[M].北京:高等教育出版社,1999.6.
    [54] 田泽.ARM9 嵌入式开发实验与实践[M]. 北京:北京航空航天大学出版社,2006.9.
    [55] 马忠梅,马广云,徐英慧,田泽.ARM 嵌入式处理器结构与应用基础.北京:北京航空航天大学出版社,2002.
    [56] MagnaChip Semiconductor Ltd.HMS30C7202 Datasheet (Version1.1)[S],2004.6.
    [57] 倪祯浩.基于 ARM 的 DDS 任意波信号发生器控制系统研究[D].西安:西北农林科技大学,2007.6.
    [58] 张永强,田紫君,申利永等. 基于 ARM 的 HMS30C7202 平台的嵌入式 Linux 移植[J].微机算机信息,2005,4:125-126.
    [59] 王红凯.基于 SL811HS 的嵌入式 USB 主控制器接口设计[J].机电工程,2008.1:31-33.
    [60] Cypress Semiconductor Corporation. SL811HS/SL811HST Application Notes (Version1.21) [S],2001.7.
    [61] Cypress Semiconductor Corporation. SL811HS/SL811S Errata Embedded USB Host/Slave Controller (Version1.2)[S],2002.4.
    [62] 罗雪莲,宋树祥.嵌入式系统中的USB接口技术.电气时代,2004.(6):48-49.
    [63] 赵蕴龙,杨孝宗,崔刚.USB HOST & HOST Controller 剖析与实现.小型微型计算机系统,2003,(1):54-57.
    [64] 翟勇.uClinux 平台上 USB 主机控制器驱动开发[D].大连:大连理工大学,2005.12.
    [65] 狄春燕.基于嵌入式系统的机器人视觉远程图像传输及网络控制[D].上海:上海交通大学,2006.2.
    [66] 姜雪莲,司徒忠.基于单片机的嵌入式 U 盘控制器的设计与实现.机电工程技术,2005,(4):79-81.
    [67] 王成,乔晓军,轩松涛,辛本胜.USB 接口芯片 SL811HS 在 51 单片机系统中的应用.国外电子元器件,2005,(2):63-65.
    [68] 王幸之,王雷,翟成等.单片机应用系统抗干扰技术[D].北京:北京航空航天大学出版社,1999. 12.
    [69] 吕扬.USB 总线协议信息包分析[J].微型机与应用 2002 年,第 1 期:28-30.
    [70] 向前.在嵌入式系统中实现对 U 盘的操作[J].单片机与嵌入式系统应用.2005.2:36-40.
    [71] Michael O, Michael K, Paul G. Universal USB Device Driver: Say goodbye to connection problems [J]. Elektor Electronics, 2007, 33 (363):40-42.
    [72] 刘少峰,韦克平 USB 软件系统的开发.计算机应用研究.2002 年,第 5 期:102-104.
    [73] 谭浩强.C 程序设计[M].北京:清华大学出版社.1999.
    [74] USB Implementers Forum. Universal Serial Bus Mass Storage Class Bulk-Only Transport (Revision1.0) [S],1999.9.
    [75] 曹国飞.嵌入式 USB 主机接口的设计[D].哈尔滨:哈尔滨理工大学,2006.3.
    [76] 叶军.基于 USB 海量存储设备类规范的文件传输系统设计[D].武汉:华中科技大学,2004:26-30.
    [77] 任博.USB HOST 技术在测井仪中的应用研究[D].西安:西北工业大学,2007.3.
    [78] 周敏奇.USB HOST 端数据采集卡设计[D].南京:南京理工大学,2005.6.
    [79] 陈飞.USB HOST 在嵌入式系统中的应用研究[D].江苏大学,2005.6.
    [80] Frank.USB 项目技术报告[R].北京:北京航空航天大学,2002.12.
    [81] American National Standards Institute. Information technology -SCSI Primary Commands - 2 (SPC-2) (Revision 20)[S],2001.7.
    [82] http://www.samsung.com/products/semiconductor/flashK 9F5608UOA.
    [83] 汤子稼,哲凤屏,汤小月.计算机操作系统[D].西安:西安电子科技大学出版社,2000:45-86.
    [84] 阎航.Flash 存储卡文件系统的研究[D].北京:北京交通大学,2006.12.
    [85] 王伟.文件系统 FAT32 与 NTFS[J].科技信息(学术研究),2007.3:549.
    [86] 优盘文件系统.2007.http://www.embed.com.cn/downcenter/Software/Catalog38/2997.htm.
    [87] Microsoft Corp. Description of the FAT file system, datasheet.USA:1999.
    [88] 邓剑,杨晓非,廖俊卿.FAT 文件系统原理及实现.计算机与数字工程[J].2005 33(9):pp.105-108.
    [89] FAT 文件系统原理.http://www.sjhf.net.
    [90] 王磊. 低功耗便携式心电仪设计与研制[D].哈尔滨:哈尔滨工程大学,2007.3.
    [91] 曹国飞,李全利.嵌入式 USB 主机文件系统的构建.自动化技术与应用[J],2005.024.
    [92] 童筱艳.便携式电子盘固化装置的设计研究[D].哈尔滨:哈尔滨工程大学,2007.1.
    [93] 王秀晶.基于 USB Host 的鲜奶收购管理系统[D]. 哈尔滨:哈尔滨工程大学,2007.1.
    [94] 卞廷波,王忠仁.USB Mass Storage 类的设备端固件开发[J].实验科学与技术.2005,12(4):49-50.
    [95] 陈智育.嵌入式系统中的 Flash 文件系统. 单片机与嵌入式系统应用[D].北京:北京航天航空大学出版社,2002.
    [96] 张延虎.嵌入式设备中文件系统的研究与实现[D].北京:北京科技大学,2005.
    [97] Microsoft Extensible Firmware Initiative FAT32 File System Specification. Microsoft Corporation,2000V.
    [98] 张长宏.基于 μCOS-Ⅱ的 Flash 文件系统的研究和实现.电子科技大学,2006.10.
    [99] 梁智勇.基于 U 盘储存的电能参数记录仪的研究与应用.广州[D]:广东工业大学,2005.11.
    [100] 周立功.ARM 嵌入式系统软件开发实例(一)[M].北京:北京航空航天大学出版社.2004.