基于U盘应用的USB2.0接口控制芯片的固件开发

上传人:枫** 文档编号:561395240 上传时间:2023-06-06 格式:DOC 页数:47 大小:2.07MB
返回 下载 相关 举报
基于U盘应用的USB2.0接口控制芯片的固件开发_第1页
第1页 / 共47页
基于U盘应用的USB2.0接口控制芯片的固件开发_第2页
第2页 / 共47页
基于U盘应用的USB2.0接口控制芯片的固件开发_第3页
第3页 / 共47页
基于U盘应用的USB2.0接口控制芯片的固件开发_第4页
第4页 / 共47页
基于U盘应用的USB2.0接口控制芯片的固件开发_第5页
第5页 / 共47页
点击查看更多>>
资源描述

《基于U盘应用的USB2.0接口控制芯片的固件开发》由会员分享,可在线阅读,更多相关《基于U盘应用的USB2.0接口控制芯片的固件开发(47页珍藏版)》请在金锄头文库上搜索。

1、摘 要USB(Universal Serial Bus,通用串行总线)是外围设备与计算机进行连接的新型接口总线。自从问世以来,凭借其高速度和高通用性迅速成为个人计算机与外未设备相连的标准接口,现在市场上售出的所有PC机都百分之百的支持USB接口,而且很多外设只推出USB版本。可以预见,USB的应用回越来越广泛,其传输速率和通用性也会越来越高。固件程序的设计是USB设备开发过程中非常重要的一个环节,它直接影响到USB设备的传输速度。本文在深入分析USB2.0协议、海量存储类规范和SCSI指令集的基础上,提出了一种专门针对U盘应用的固件设计方法,重点论述了固件实现过程中的几个关键技术,证明USB2

2、.0接口控制芯片的固件设计达到了预期目标。由于USB2.0协议的主/从式模式,固件的整个流程基于中断模式实现。固件程序主要包括三部分:1)初始化单片机和所有外围电路;2)中断服务程序,完成各个模块产生的中断响应;3)任务处理子模块,供中断服务程序调用,完成具体的USB设备操作。在实现的过程中,主处理程序完成系统的初始化并轮询中断,固件负责协议的解析和处理,不干预数据的传输,这样,保证了快速的数据传输和较好的软件结构。通过对调试过程和性能测试结果,我们可以看出,固件能够控制硬件电路快速的完成各种操作,达到了预期的设计目标。关键词:通用串行总线;固件;闪存;块传ABSTRACTUniversal

3、Serial Bus(USB)is a new type of serial bus which connects peripherals to computer.Since its advent,USB has rapidly become a standard interface between personal computer(PCs)and peripherals for its high transfer speed and applicability.All PCs on market today support USB interface with no exception,w

4、hile many peripherals are found with only USB interfaces.It is predictable that USb will be more and more popular with its transfer speed and applicability being increasesd.Firmware is very important in a USB device project, which affects the transfer speed of USB directly.This dissertation puts for

5、ward a new solution on the firmwares design of flash memory disk based on studying USB2.0 protocol, mass storage class and Small Computer System Interface (SCSI) command sets thoroughly. This dissertation describes the key technologies during the realization of firmware being designed.which testifie

6、s that the firmware of USB2.0 Interface Controller ASIC achieves the desired sights.In accordance with the Master-Slave architecture in USB 2.0 protocol, the workflow of the firmware is implemented based on interrupt pattern. The firmware program includes three sections: initialization microcontroll

7、er and all the peripheral circuits; interrupt service routine, which triggers interrupts and executes the interrupt;task module, which is called by the ISR.During the procedure of realization, main programme implements the initialization of system and waits for the occurrence of interrupt, the ISR c

8、alls the task module to execute the operation. The firmware analyzes the protocols and does not disturb the transfer of data. Thus, this procedure can not only guarantee the high transfer speed and good software structure but also simplify the design and test.In accordance with the Master-Slave arch

9、itecture in USB 2.0 protocol, the workflow of the firmware is implemented based on interrupt pattern. The firmware program includes three sections: initialization microcontroller and all the peripheral circuits; interrupt service routine, which triggers interrupts and executes the interrupt;task mod

10、ule, which is called by the ISR.During the procedure of realization, main programme implements the initialization of system and waits for the occurrence of interrupt.The firmware analyzes the protocols and does not disturb the transfer of data. Thus, this procedure can not only guarantee the high tr

11、ansfer speed and good software structure.Key words:Universal Serial Bus;firmware;flash memory;Bulk-Only transport protocol目 录1 绪论11.1 USB技术发展现状与研究意义11.2 工作目标12 协议分析2协议分析22.1.1 USB的系统结构22.1.2 USB数据基本类型42.1.3 USB数据传输82.1.4 USB设备8海量存储类规范介绍102.2.1 Bulk-Only传输流程102.2.2 Bulk-Only的几种传输情形132.3 SCSI命令简介143 内

12、置控制器的单片机AT89C5131173.1 AT89C5131特点概述173.2 USB控制器的结构与配置17接口控制芯片固件的设计与实现19固件设计方案及工作流程19固件的设计思想19固件的工作流程19固件的总体划分214.1.4 USB2.0接口控制芯片固件的实现224.2 固件主处理层的实现过程22系统上电及初始化处理224.2.2 USB标准请求实现过程235.2.3 描述符表264.3 Bulk-Only传输处理层实现过程274.4 SCSI指令处理层实现过程284.4.1 Read(10)命令处理过程285.4.2 Write(10)命令处理过程294.4.3 其他命令的处理30

13、4.4.3 其他命令的处理30闪存处理层的实现过程304.5.1 FLASH的擦除操作314.5.2 FLASH的写入操作314.5.3 FLASH的读取操作325 U盘系统的虚拟测试345.1 Proteus ISIS简介345.2 Keil uVision3简介345.3 系统虚拟测试步骤355.3.1 生成机器码355.3.2 虚拟电路图的绘制355.3.3 导入程序模拟运行366 U盘系统实物测试39结束语41致谢42参考文献431 绪 论USB的英文全称为Universal Serial Bus,中文含义是通用串行总线,它是一种快速的,双向的,同步传输的廉价的并可以进行热拔插的串行接

14、口。USB接口使用方便,它可以连接多个不同的设备,而过去的串口和并口只能接一个设备。速度快是USB技术的突出特点之一。全速USB接口的最高传输率可达12Mb/s,比串口快了整整100倍,USB标准的高速USB接口速率更是达到了480Mb/s。这使得高分辨率、真彩色的大容量图象的实时传送成为可能。USB接口支持多个不同设备的串行连接,一个USB接口理论上可以连接127个USB设备。连接方式也十分灵活,既可以使用串行连接,也可以使用集线器(Hub)把多个设备连接在一起,再同PC机的USB接口相接。普通的使用串口、并口的设备都需要单独的供电系统,而USB设备则不需要。正是由于USB的这些特点,使其获

15、得了广泛的应用。到目前为止,USB已经在PC机的多种外设上得到应用,包括扫描仪,数码相机,数码摄像机、音频系统、显示器、输入设备等。对于广大的工程设计人员来说,USB是设计外设接口时理想的总线。1.1 USB技术发展现状与研究意义USB接口蕴藏了巨大的市场需求,国外很早就开始USB接口芯片的研发,甚至早在2001年,Cypress和Phileps就推出了USB接口芯片。目前,市场上流行的USB接口芯片有两种类型:一种是集成微处理器的USB接口控制芯片;另一种是纯粹的USB接口芯片,仅处理USB通讯。U盘是USB接口最主要的一种应用,它以小巧方便,存储量大,寿命长等优点取代了软盘,成为市场上最为

16、主要的一种便携存储设备,几乎人人都使用。 工作目标围绕本课题,作者主要要做以下工作:对课题中涉及的理论基础做了深入的学习和研究,主要包括USB的协议原理、Bulk-Only传输协议、针对Flash介质的SCSI指令集等,参与U盘系统开发,硬件模块的划分和寄存器的定义。掌握软件设计和开发的一般方法、步骤,使开发具有较好的可靠性、可维护性和可读性。完成固件的设计和代码的编写,主要包括系统的初始化、设备的枚举过程的实现、Bulk-Only传输的实现、SCSI指令的解析以及闪存的控制。完成固件的调试和系统性能的测试,验证了课题的开发是否达到预期的目的。2 协议分析本章主要分析了论文所涉及的各种协议,包括USB协议、

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 幼儿/小学教育 > 幼儿教育

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号