节点文献

基于USB接口的数据采集系统的研究与设计

Research and Design of Data Acquisition System Based on USB Interface

【作者】 陈明明

【导师】 沈维聪;

【作者基本信息】 武汉理工大学 , 信号与信息处理, 2008, 硕士

【摘要】 通用串行总线(USB)具有成本低,使用方便,支持热插拔,传输速率高,功耗低等优点,已被广泛应用于PC机及嵌入式系统中。采用USB接口进行数据采集是本课题的一大特点。本文首先研究了USB接口的通信协议,包括USB基本架构与总线结构,硬件规范,NRZI编码方式,控制传输、批量传输、中断传输以及等时传输四种USB数据传输方式,设备枚举及USB设备描述符等内容。接着,通过ATMEL的89S52单片机和Philips公司的PDIUSBD12接口芯片实现了模拟信号的采集与传输。其具体实现过程包括单片机端的固件程序设计,USB设备驱动程序设计及其上位机应用程序设计三大模块。固件编程设计采用分层结构进行,实现了USB协议的解析和应答,完成了模拟信号的采集和传输等过程,并且通过给出部分源程序代码和程序流程图,采用从下向上的层次顺序详细研究了硬件提取层、PDIUSBD12命令接口层、中断服务程序、标准设备请求及主循环程序的实现过程。USB设备驱动程序为上位机应用程序访问硬件设备提供了统一的软件接口,USB的设备驱动程序必须符合Microsoft定义的Win32驱动程序模型(Win32Driver Model,WDM)规格。在此本文选用Numega公司的第三方驱动程序开发工具DriverStudio,由于它所含的DriverWorks工具提供独特的DriverWizard向导,包含丰富的例子和库的完整源代码,可以引导用户根据实际需要完成设备驱动程序开发的全过程,所以利用它大大简化了设备驱动程序的开发过程。上位机应用程序采用了C++Builder开发工具,通过调用Win32 API函数的打开设备CreateFile0、读/写设备WriteFile0/ReadFile0、I/O设备控制DeviceIOControl0及关闭设备CloseFile0等函数即可实现与基于USB接口的数据采集系统的通信。本设计实现了外部信号的采集并通过USB接口传输到PC机上实现了实时显示。本系统由于引入了USB接口,较以前的传统接口提高了数据传输的速率,支持热插拔,使用更方便。

【Abstract】 Universal Serial Bus (USB) has been used widely in PC and embedded systems because of its many merits, such as low-cost, supporting of plug-and-play, high transmission rate and low power consumption. Data acquisition by USB Interface is a marking feature of this research.Firstly, this paper introduces the USB communication protocol. It includes USB basic structure, bus architecture, hardware standards, NRZI pattern of coding, control transfer、bulk transfer、interrupt transfer and isochronous transfer four types of transmission, equipment enumeration and USB device descriptors and so on.Secondly, the thesis introduces how to collect and transmit analog signal by using 89S52 MCU of ATMEL and PDIUSBD12 interface chip of Philips. The specific design consists of three modules: the firmware design of MCU, design of the USB device driver and application design of PC.Firmware programming is the most important task, because it accomplishes the USB protocol analysis and response, and achieves the process of analog signal acquisition and transmission. To identify the peripheral acquisition system of the host, firmware program must be well prepared. After introducing hardware abstraction layer, PDIUSBD12 Command Interface layer, interrupt service requests, standard device requests and the main cycling program, a hierarchical structure is presented. And some source codes and program flow chart are illustrated.USB device driver provides a unified software interface for PC application to access hardware device, the USB device driver must be accord with Win32 Driver Model (Win32 Driver Model, WDM) specifications defined by Microsoft Corp. This thesis chooses the third-part driver development tools of DriverStudio designed by Numega Corp. Because the DriverWorks tool provides a unique DriverWizard guidance and contains abundant examples and integrates source codes, it can guide us to develop the device driver during the whole process. It greatly simplifies the development process of device driver. The PC application is developed by means of C++ Builder. By calling the Win32 API functions, such as opening the device, reading / writing device, I /O device control and closing device, communication of the peripheral USB acquisition system can be realized at once.This design has realized external signal collecting and transmits on PC machine through the USB interface to realize the real time display. Because of introducing the USB interface, compared the traditional interface, the system enhanced the data transmission speed, supporting plug and play and becomes more convenient.

【关键词】 USBPDIUSBD12设备驱动WDMC++Builder
【Key words】 USBPDIUSBD12Device DriverWDMC++ Builder
  • 【分类号】TP274.2
  • 【被引频次】16
  • 【下载频次】854
节点文献中: 

本文链接的文献网络图示:

本文的引文网络