基于USB总线的设计和开发

时间:2022-07-12 09:56:55

【前言】基于USB总线的设计和开发由文秘帮小编整理而成,但愿对你的学习工作带来帮助。This paper introduced a simple and convenient method to design aUSB apparatus, that is to say, to realize an intact USB apparatuswith a minimum system of single-chip computer that made of 51single-chip computer and USB interface. In later chapters,...

基于USB总线的设计和开发

本文介绍了一种比较简单方便设计usb设备的方法,设计采用51单片机和USB接口芯片组成的单片机最小系统来实现一个完整的USB设备。

USB设备都可以归结为控制器和USB电气接口这两个基本部分的组合。在设计中,采用的控制器是51单片机AT89C51,USB电气接口则是PHILIPS公司的USB接口芯片PDIUSBD12。单片机控制器作为下位机,通过USB电气接口芯片和USB总线与PC机交换数据,并实现USB设备的逻辑功能。

本文结合USB1.1接口技术,从硬件和软件两个方面,从电路设计、固件程序设计、驱动程序和应用程序设计,由低层到高层逐步详细讲解USB设备的开发过程。本文的重点在于阐述系统硬件设计和系统固件的实现方法。论文首先简要介绍了USB接口的现状和发展趋势,系统要实现的功能,以及各章节的安排;然后简要介绍了USB体系,让读者对USB协议有一定的了解;接着详细介绍了系统的硬件设计方案,包括由C51和PIDUSBD12芯片组成的USB基本功能模块,系统扩展功能模块的设计和实现方法;紧接着介绍了系统软件的具体实现,包括固件程序,系统驱动程序和应用程序的设计实现。这一部分重点阐述了系统固件的实现,以及如何运用软件工具WinDriver开发系统驱动和应用程序;论文最后一部分讲述了系统的调试过程,包括硬件测试和在WinDriver环境下的系统调试,以及在调试过程遇到的问题和解决方法。

系统开发的最终硬件成果是一个带有USB接口的设备,通过USB电缆与PC机相连接,能够实现主机对设备的列举,以及和PC机交换数据,并实现其扩展功能。

ABSTRACT

This paper introduced a simple and convenient method to design aUSB apparatus, that is to say, to realize an intact USB apparatuswith a minimum system of single-chip computer that made of 51single-chip computer and USB interface. In later chapters, we cansee, all the USB apparatus can come down to two basic associationof part: a controller and a USB electric interface. In this system,I adopted 51 one-chip computer AT89C51 as its controller, the chipPDIUSBD12 of PHILIPS Company as its electric interface. Theone-chip computer as the next machine, exchanges the data with thePC, through the USB bus and USB electric interface chip, and itrealizes the logic function of USB apparatus.

The paper, combing the USB1.1 interface technology, from thehardware to the software, from the circuit design and the design offirmware program, to the design of driver and employ program, fromthe low. to the senior level, explain progressively the developmentcourse of USB apparatus in detail. It emphasize in introducing thedesign of hardware and firmware. The paper is described in fourparts. First part studied the development trend of USB interface,the function to realize, and the arrangement of every chapters inbrief. Second part brief introduced USB system, lets us have apreliminary knowledge of USB protocol. The third part introducedthe design of the hardware of the system, including the minimumsystem of single-chip computer that made of 51 single-chip computerand USB interface, and the expand module of the system. The fourthpart recommended the software of the system, including design offirmware program, driver and employ program. This chapter willemphasize in describing the design of firmware.

The final hardware achievement is a piece of equipment with USBinterface, it can exchange data with PC, and realize its expandfunction, through connecting with PC.

Keywords: USB single-chipcomputer system Firmware WinDriver

目 录

第1章 绪论 ......................................................................1

1.1 选题现状以及发展趋势 .........................................................1

1.2 系统实现功能................................................................. 1

1.3 论文内容及组织结构........................................................... 2

第2章 USB技术.................................................................... 3

2.1 USB总线概述 ..................................................................3

2.1.1 USB总线简介................................................................ 3

2.2.2 USB总线的优点 ..............................................................3

2.2 USB协议简介 ..................................................................4

2.2.1 USB物理体系结构 ............................................................4

2.2.2 USB设备逻辑结构 ............................................................5

2.2.3 USB传输类型 ................................................................6

2.2.4 USB低层通信协议 ............................................................6

2.3 USB接口技术.................................................................. 8

第3章 系统硬件电路设计 ...........................................................9

3.1 设备电路系统概述............................................................. 9

3.2 51单片机最小系统............................................................. 9

3.3 PDIUSBD12电路及其与单片机的连接设计 ......................................10

3.3.1 PDIUSBD12介绍 ..............................................................10

3.3.2 USB电路及其与单片机连接 ................................................14

3.4 扩展功能电路的设计......................................................... ..15

3.4.1 PS/2串行接口的扩展设计 .....................................................15

3.4.2 Flash存储器的扩展设计 ......................................................16

3.4.3 LPT并行接口的扩展设计 ......................................................17

第4章 系统软件设计............................................................... 19

4.1 固件程序的设计与实现......................................................... 19

4.1.1 描述符 .....................................................................19

4.1.2 固件程序的结构 .............................................................20

4.2 驱动程序的设计与实现 .........................................................24

4.2.1 驱动程序概述 ...............................................................24

4.2.2 WDM设备驱动程序结构 ........................................................24

4.2.3 驱动程序开发的工具软件......................................................25

4.2.4 用WinDriver开发驱动程序 ...................................................25

4.3 系统应用程序开发 .............................................................26

4.3.1 应用程序的实现的功能 .......................................................26

4.3.2 利用WinDriver实现应用程序................................................. 27

第5章 系统调试 ...................................................................28

5.1 系统硬件测试................................................................. 28

5.2 系统软件调试及系统测试 .......................................................28

结束语......................................................... ...................30

参考文献.......................................................................... 31

附录 .............................................................................32

上一篇:嵌入式处理器MPC8250与CF卡的接口设计 下一篇:全面预算内部控制设计流程