基于usb總線的高速數(shù)據(jù)采集系統(tǒng)設(shè)計(jì).doc
約52頁(yè)DOC格式手機(jī)打開(kāi)展開(kāi)
基于usb總線的高速數(shù)據(jù)采集系統(tǒng)設(shè)計(jì),摘要通用串行總線usb(universal serial bus)是一種新型的微機(jī)總線接口規(guī)范。隨著客戶(hù)對(duì)系統(tǒng)數(shù)據(jù)采集速度要求的不斷提高,usb以其使用方便、易于擴(kuò)展、速度快等優(yōu)點(diǎn)而越來(lái)越多的應(yīng)用于數(shù)據(jù)采集系統(tǒng)中。本文介紹了一種基于usb總線的數(shù)據(jù)采集系統(tǒng)的設(shè)計(jì)方法,采用philips公司的usb接口芯片pdiusbd...
內(nèi)容介紹
此文檔由會(huì)員 wanli1988go 發(fā)布
摘要
通用串行總線USB(Universal Serial Bus)是一種新型的微機(jī)總線接口規(guī)范。隨著客戶(hù)對(duì)系統(tǒng)數(shù)據(jù)采集速度要求的不斷提高,USB以其使用方便、易于擴(kuò)展、速度快等優(yōu)點(diǎn)而越來(lái)越多的應(yīng)用于數(shù)據(jù)采集系統(tǒng)中。本文介紹了一種基于USB總線的數(shù)據(jù)采集系統(tǒng)的設(shè)計(jì)方法,采用PHILIPS公司的USB接口芯片PDIUSBD12與單片機(jī)AT89C51進(jìn)行通信,并和PC機(jī)通信而編制出友善的設(shè)備應(yīng)用程序。該系統(tǒng)用傳統(tǒng)的USB總線取代了RS232串行總線,通過(guò)對(duì)USB協(xié)議和設(shè)備構(gòu)架的充分理解,對(duì)以單片機(jī)89C51和USB接口芯片PDIUSBD12為主的數(shù)據(jù)采集系統(tǒng)進(jìn)行了硬件設(shè)計(jì)和軟件編程,并在此設(shè)計(jì)的基礎(chǔ)上給出相應(yīng)的原理圖。硬件設(shè)計(jì)主要解決的是PDIUSBD12和ADC0809與單片機(jī)之間的接口電路問(wèn)題,軟件編程大致分為三部分:一是為滿足D12在USB上的最大傳輸速率而編寫(xiě)的固件程序;二是在PC機(jī)中的Windows 2000工作環(huán)境下編寫(xiě)USB設(shè)備驅(qū)動(dòng)程序;三是充分了解D12的主要功能特點(diǎn),并編寫(xiě)出應(yīng)用程序。通過(guò)該數(shù)據(jù)采集系統(tǒng),我們可以對(duì)USB協(xié)議有很深刻的理解,對(duì)D12接口芯片有很熟練的應(yīng)用,能更好領(lǐng)悟USB接口的優(yōu)勢(shì)。
關(guān)鍵詞:USB總線;單片機(jī);數(shù)據(jù)采集;固件;Windows驅(qū)動(dòng)程序模型;設(shè)備驅(qū)動(dòng)程序;客戶(hù)應(yīng)用程序
ABSTRACT
Universal Serial Bus is a new specification for microcomputer bus interface. With the continuing advance of the clients' demand for the speed of a data collection system, USB is more and more widely used in data collection system for its advantages such as convenience, expanding port with ease and high speed etc.
this article presents a particular description of the design and development of a data collection system based on USB.single chip programs the fireware to the USB interface chip—PDIUSBD12; communication appears between D12 and up-location computer and man-machine mutual interface comes into being; lots of data from the industry spot are printed, analyzed and disposed on time. On the base of wonderful understanding to USB protocol and device truss, I finish the hardware design and software programme of the data collection system. And draw the principle chart.
? The software programme mainly includes: the fireware code in need of D12's maximum transmission rate; USB device driver and client application under the circustance of Win2000 operation system in computer. After this data collection system,we can understand the USB protocol profoundly and apply the interface chip-PDIUSBDI2 proficiently. In all, the advantages of this interface technique may helps to your design arrangement.
KEY WORDS:USB bus;data collection;MCU;fireware;WDM;device drive program;client application
目錄
文摘 1
英文文摘 1
1 緒論
1.1 課題背景
1.2 課題的提出
1.3 USB簡(jiǎn)介
1.4 主要工作
2 USB1.1協(xié)議
2.1 USB的互連
2.2 USB的主機(jī)
2.2.1 USB主機(jī)概述
2.2.2 USB驅(qū)動(dòng)(USBD)
2.3USB設(shè)備
2.3.1 USB設(shè)備狀態(tài)
2.3.2 通用USB設(shè)備操作
2.3.3 USB設(shè)備請(qǐng)求
2.4 USB的物理層
2.5 USB數(shù)據(jù)流
3 數(shù)據(jù)采集系統(tǒng)的固件設(shè)計(jì)
3.1 固件的開(kāi)發(fā)環(huán)境
3.2 采用PDIUSBD12的固件設(shè)計(jì)
3.2.1 固件要完成的主要工作
3.2.2 PDIUSBD12芯片特點(diǎn)
3.2.3 PDIUSBD12固件程序的編寫(xiě)
3.3 固件的文件結(jié)構(gòu)
3.4 固件的編程實(shí)現(xiàn)
3.4.1 底層函數(shù)
3.4.2 命令接口
3.4.3 中斷服務(wù)程序ISR.C
3.4.4 主循環(huán)MAINLOOP.C
4 USB設(shè)備驅(qū)動(dòng)程序設(shè)計(jì)
4.1 Windows2000驅(qū)動(dòng)程序
4.2 WDM驅(qū)動(dòng)程序結(jié)構(gòu)模型
4.2.1 USB設(shè)備驅(qū)動(dòng)程序?qū)哟谓Y(jié)構(gòu)
4.2.2設(shè)備對(duì)象
4.2.3標(biāo)準(zhǔn)總線驅(qū)動(dòng)程序和類(lèi)驅(qū)動(dòng)程序
4.2.4 WDM驅(qū)動(dòng)程序的結(jié)構(gòu)
4.3 USB驅(qū)動(dòng)的開(kāi)發(fā)環(huán)境
4.3.1 驅(qū)動(dòng)的開(kāi)發(fā)工具
4.3.2 驅(qū)動(dòng)開(kāi)發(fā)環(huán)境的安裝與設(shè)置
4.4 驅(qū)動(dòng)程序的實(shí)現(xiàn)
4.4.1 驅(qū)動(dòng)入口
4.4.2數(shù)據(jù)傳輸控制
5 USB設(shè)備應(yīng)用程序設(shè)計(jì)
5.1 Win32 API簡(jiǎn)介
5.2動(dòng)態(tài)鏈接庫(kù)
5.3 MFC的應(yīng)用程序開(kāi)發(fā)
5.4設(shè)備應(yīng)用程序與WDM的通信
5.4.1 Win32應(yīng)用程序?qū)DM的通信
5.4.2 WDM對(duì)Win32應(yīng)用程序的通信
5.5 應(yīng)用程序的實(shí)現(xiàn)
6 數(shù)據(jù)采集系統(tǒng)的硬件設(shè)計(jì)
6.1 硬件系統(tǒng)的結(jié)構(gòu)
6.2 接口芯片選擇
6.3 接口硬件設(shè)計(jì)
6.3.1 A/D與單片機(jī)接口電路
6.3.2 PDIUSBDI2與單片機(jī)接口電路
7 結(jié)論…………………………………………………………………………
8 參考文獻(xiàn)……………………………………………………………………..
參考文獻(xiàn)
[1] 陳啟美,丁傳鎖編著.計(jì)算機(jī)USB接口設(shè)計(jì)[M].南京:南京大學(xué)出版社,2003.1
[2] 尹勇,王洪成編著.單片機(jī)開(kāi)發(fā)環(huán)境μVision 2的使用指南及USB固件編程與調(diào)試[M].北京:北京航空航天大學(xué)出版社,2004.1
[3]李全利,遲榮強(qiáng)編著.單片機(jī)原理及接口技術(shù)[M].北京:高等教育出版社,2004.1
[4]周立功編著.PDIUSBDI2 USB固件編程與驅(qū)動(dòng)開(kāi)發(fā)[M].北京:北京航空航天大學(xué)出版社,2003.2
[5]邊海龍,賈少華編著.USB2.0設(shè)備的設(shè)計(jì)與開(kāi)發(fā)[M].北京:人民郵電出版社,2004.1
[6]張弘編著.USB接口設(shè)計(jì)[M].西安:西安電子科技大學(xué)出版社,2002.1
[7]坎特編著.Windows WDM設(shè)備驅(qū)動(dòng)程序開(kāi)發(fā)指南[M].孫義,馬莉波等譯.北京:機(jī)械工業(yè)出版社,2000.1
[8]劉炳文,李鳳華編著Visual Basic 6.0 Win32 API程序設(shè)計(jì)[M].北京:清華大學(xué)出版社,2001.9
[9]張惠娟,周利華,瞿鴻鳴編著.Windows環(huán)境下的設(shè)備驅(qū)動(dòng)程序設(shè)計(jì)[M].西安:西安電子科技大學(xué)出版社,2002.5
[10]齊舒創(chuàng)作室編著.Visual C++6.0開(kāi)發(fā)技巧及實(shí)例剖析[M].北京:清華大學(xué)出版社,1999.1
[11] Compaq, Intel, Micros..
通用串行總線USB(Universal Serial Bus)是一種新型的微機(jī)總線接口規(guī)范。隨著客戶(hù)對(duì)系統(tǒng)數(shù)據(jù)采集速度要求的不斷提高,USB以其使用方便、易于擴(kuò)展、速度快等優(yōu)點(diǎn)而越來(lái)越多的應(yīng)用于數(shù)據(jù)采集系統(tǒng)中。本文介紹了一種基于USB總線的數(shù)據(jù)采集系統(tǒng)的設(shè)計(jì)方法,采用PHILIPS公司的USB接口芯片PDIUSBD12與單片機(jī)AT89C51進(jìn)行通信,并和PC機(jī)通信而編制出友善的設(shè)備應(yīng)用程序。該系統(tǒng)用傳統(tǒng)的USB總線取代了RS232串行總線,通過(guò)對(duì)USB協(xié)議和設(shè)備構(gòu)架的充分理解,對(duì)以單片機(jī)89C51和USB接口芯片PDIUSBD12為主的數(shù)據(jù)采集系統(tǒng)進(jìn)行了硬件設(shè)計(jì)和軟件編程,并在此設(shè)計(jì)的基礎(chǔ)上給出相應(yīng)的原理圖。硬件設(shè)計(jì)主要解決的是PDIUSBD12和ADC0809與單片機(jī)之間的接口電路問(wèn)題,軟件編程大致分為三部分:一是為滿足D12在USB上的最大傳輸速率而編寫(xiě)的固件程序;二是在PC機(jī)中的Windows 2000工作環(huán)境下編寫(xiě)USB設(shè)備驅(qū)動(dòng)程序;三是充分了解D12的主要功能特點(diǎn),并編寫(xiě)出應(yīng)用程序。通過(guò)該數(shù)據(jù)采集系統(tǒng),我們可以對(duì)USB協(xié)議有很深刻的理解,對(duì)D12接口芯片有很熟練的應(yīng)用,能更好領(lǐng)悟USB接口的優(yōu)勢(shì)。
關(guān)鍵詞:USB總線;單片機(jī);數(shù)據(jù)采集;固件;Windows驅(qū)動(dòng)程序模型;設(shè)備驅(qū)動(dòng)程序;客戶(hù)應(yīng)用程序
ABSTRACT
Universal Serial Bus is a new specification for microcomputer bus interface. With the continuing advance of the clients' demand for the speed of a data collection system, USB is more and more widely used in data collection system for its advantages such as convenience, expanding port with ease and high speed etc.
this article presents a particular description of the design and development of a data collection system based on USB.single chip programs the fireware to the USB interface chip—PDIUSBD12; communication appears between D12 and up-location computer and man-machine mutual interface comes into being; lots of data from the industry spot are printed, analyzed and disposed on time. On the base of wonderful understanding to USB protocol and device truss, I finish the hardware design and software programme of the data collection system. And draw the principle chart.
? The software programme mainly includes: the fireware code in need of D12's maximum transmission rate; USB device driver and client application under the circustance of Win2000 operation system in computer. After this data collection system,we can understand the USB protocol profoundly and apply the interface chip-PDIUSBDI2 proficiently. In all, the advantages of this interface technique may helps to your design arrangement.
KEY WORDS:USB bus;data collection;MCU;fireware;WDM;device drive program;client application
目錄
文摘 1
英文文摘 1
1 緒論
1.1 課題背景
1.2 課題的提出
1.3 USB簡(jiǎn)介
1.4 主要工作
2 USB1.1協(xié)議
2.1 USB的互連
2.2 USB的主機(jī)
2.2.1 USB主機(jī)概述
2.2.2 USB驅(qū)動(dòng)(USBD)
2.3USB設(shè)備
2.3.1 USB設(shè)備狀態(tài)
2.3.2 通用USB設(shè)備操作
2.3.3 USB設(shè)備請(qǐng)求
2.4 USB的物理層
2.5 USB數(shù)據(jù)流
3 數(shù)據(jù)采集系統(tǒng)的固件設(shè)計(jì)
3.1 固件的開(kāi)發(fā)環(huán)境
3.2 采用PDIUSBD12的固件設(shè)計(jì)
3.2.1 固件要完成的主要工作
3.2.2 PDIUSBD12芯片特點(diǎn)
3.2.3 PDIUSBD12固件程序的編寫(xiě)
3.3 固件的文件結(jié)構(gòu)
3.4 固件的編程實(shí)現(xiàn)
3.4.1 底層函數(shù)
3.4.2 命令接口
3.4.3 中斷服務(wù)程序ISR.C
3.4.4 主循環(huán)MAINLOOP.C
4 USB設(shè)備驅(qū)動(dòng)程序設(shè)計(jì)
4.1 Windows2000驅(qū)動(dòng)程序
4.2 WDM驅(qū)動(dòng)程序結(jié)構(gòu)模型
4.2.1 USB設(shè)備驅(qū)動(dòng)程序?qū)哟谓Y(jié)構(gòu)
4.2.2設(shè)備對(duì)象
4.2.3標(biāo)準(zhǔn)總線驅(qū)動(dòng)程序和類(lèi)驅(qū)動(dòng)程序
4.2.4 WDM驅(qū)動(dòng)程序的結(jié)構(gòu)
4.3 USB驅(qū)動(dòng)的開(kāi)發(fā)環(huán)境
4.3.1 驅(qū)動(dòng)的開(kāi)發(fā)工具
4.3.2 驅(qū)動(dòng)開(kāi)發(fā)環(huán)境的安裝與設(shè)置
4.4 驅(qū)動(dòng)程序的實(shí)現(xiàn)
4.4.1 驅(qū)動(dòng)入口
4.4.2數(shù)據(jù)傳輸控制
5 USB設(shè)備應(yīng)用程序設(shè)計(jì)
5.1 Win32 API簡(jiǎn)介
5.2動(dòng)態(tài)鏈接庫(kù)
5.3 MFC的應(yīng)用程序開(kāi)發(fā)
5.4設(shè)備應(yīng)用程序與WDM的通信
5.4.1 Win32應(yīng)用程序?qū)DM的通信
5.4.2 WDM對(duì)Win32應(yīng)用程序的通信
5.5 應(yīng)用程序的實(shí)現(xiàn)
6 數(shù)據(jù)采集系統(tǒng)的硬件設(shè)計(jì)
6.1 硬件系統(tǒng)的結(jié)構(gòu)
6.2 接口芯片選擇
6.3 接口硬件設(shè)計(jì)
6.3.1 A/D與單片機(jī)接口電路
6.3.2 PDIUSBDI2與單片機(jī)接口電路
7 結(jié)論…………………………………………………………………………
8 參考文獻(xiàn)……………………………………………………………………..
參考文獻(xiàn)
[1] 陳啟美,丁傳鎖編著.計(jì)算機(jī)USB接口設(shè)計(jì)[M].南京:南京大學(xué)出版社,2003.1
[2] 尹勇,王洪成編著.單片機(jī)開(kāi)發(fā)環(huán)境μVision 2的使用指南及USB固件編程與調(diào)試[M].北京:北京航空航天大學(xué)出版社,2004.1
[3]李全利,遲榮強(qiáng)編著.單片機(jī)原理及接口技術(shù)[M].北京:高等教育出版社,2004.1
[4]周立功編著.PDIUSBDI2 USB固件編程與驅(qū)動(dòng)開(kāi)發(fā)[M].北京:北京航空航天大學(xué)出版社,2003.2
[5]邊海龍,賈少華編著.USB2.0設(shè)備的設(shè)計(jì)與開(kāi)發(fā)[M].北京:人民郵電出版社,2004.1
[6]張弘編著.USB接口設(shè)計(jì)[M].西安:西安電子科技大學(xué)出版社,2002.1
[7]坎特編著.Windows WDM設(shè)備驅(qū)動(dòng)程序開(kāi)發(fā)指南[M].孫義,馬莉波等譯.北京:機(jī)械工業(yè)出版社,2000.1
[8]劉炳文,李鳳華編著Visual Basic 6.0 Win32 API程序設(shè)計(jì)[M].北京:清華大學(xué)出版社,2001.9
[9]張惠娟,周利華,瞿鴻鳴編著.Windows環(huán)境下的設(shè)備驅(qū)動(dòng)程序設(shè)計(jì)[M].西安:西安電子科技大學(xué)出版社,2002.5
[10]齊舒創(chuàng)作室編著.Visual C++6.0開(kāi)發(fā)技巧及實(shí)例剖析[M].北京:清華大學(xué)出版社,1999.1
[11] Compaq, Intel, Micros..