簡易檢索 / 詳目顯示

研究生: 高智仁
Chih-Jen Kao
論文名稱: 實現以USB為基礎的高速資料擷取裝置
Implementing high-speed data acquisition equipment base on USB
指導教授: 許孟超
Mon-Chau Shie
口試委員: 梁文耀
Wen-Yew Liang
阮聖彰
Shanq-Jang Ruan
學位類別: 碩士
Master
系所名稱: 電資學院 - 電子工程系
Department of Electronic and Computer Engineering
論文出版年: 2009
畢業學年度: 97
語文別: 中文
論文頁數: 67
中文關鍵詞: 資料擷取通訊協定端點重新列舉
外文關鍵詞: NRZI, EZ-USB FX2, Slave FIFO, SDCC
相關次數: 點閱:185下載:4
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 從1999年USB 2.0標準發佈後,憑藉著方便性和高速的傳輸,至今USB 2.0幾乎已成為PC與周邊溝通必備的標準介面。目前以PC為架構之USB介面的資料擷取裝置,大多有高成本與低彈性的缺點,如果可以藉由USB的普及性和高速傳輸的優點,自主開發以USB通訊介面為基礎的資料擷取裝置,相信可以解決高成本與低彈性的缺點。

    本論文將使用Cypress半導體公司之EZ-USB FX2晶片為主的USB開發板作為與PC之間的通訊介面,而利用Altera公司的CPLD 為核心的AD/IO擴充電路產生出所要擷取的波形資料,實作出具備高速傳輸的資料擷取裝置。軟體方面著重在EZ-USB FX2韌體的自主開發,將發展出一組基礎函式庫以供撰寫各種韌體所需,並在Linux平台下完成所有韌體的開發程序,最後於Windows下將撰寫圖形化的應用程式以展示EZ-USB FX2所擷取到的波形資料。

    在整篇論文中,首先會概括說明USB通訊協定,EZ-USB FX2晶片特性和硬體架構平台,並且介紹如何利用EZ-USB FX2之Slave FIFO來達成與CPLD間的高速資料傳輸,最後將描述韌體的設計並展示具圖形化的視窗程式的測試結果。


    USB 2.0 standard is published in 1999, with the convenience and high-speed transmission, USB 2.0 now has become an essential communication standard between PC and peripheral interface. Currently, PC-based data acquisition equipments are almost high-cost and low flexibility. If we take the advantage of the popularity and high-speed transmission and develop the firmware of USB Soc by self, it is believed that can solve the shortcomings.

    This thesis will adopt USB 2.0 development board, base on EZ-USB FX2 Soc, use the CPLD AD/IO board for generate the datum of waveform and implement of high-speed data acquisition equipment.

    We will focus on the self-developed EZ-USB FX2 firmware. First, make a basic library for building variety of different types of firmware use. All the making firmware procedures are using free/open source software on linux platform and demonstrate the research result using GUI program on Windows platform.

    The thesis will briefly first describe the USB protocol, architecture of EZ-USB FX2 Soc and how to use the Slave FIFO mode of EZ-USB FX2 to transmission with CPLD.

    第一章 序論1 1.1 研究動機與目的1 1.2 研究背景1 1.3 論文架構1 第二章 USB 通訊協定2 2.1 USB特性與組成元件2 2.2 USB裝置分類3 2.3 USB電源管理3 2.4 傳輸架構4 2.4.1 物理層(The Physical Layer)6 2.4.1.1 NRZI編碼6 2.4.1.2 串列介面引擎SIE(Serial Interface Engine)7 2.4.1.3 主端控制器HC(Host Controller)7 2.4.2 協定層(The Protocol Layer)7 2.4.2.1 USB軟體架構7 2.4.2.2 USB邏輯裝置(Logical Device)7 2.4.3 應用層(The Application Layer)8 2.5 USB通訊協定8 2.5.1 USB交易(Transaction)與Packet ID(PID)8 2.5.2 USB封包(Packet)8 2.5.2.1 Token 封包9 2.5.2.2 Data 封包9 2.5.2.3 Handshake 封包9 2.5.3 封包格式9 2.5.4 封包種類9 2.5.4.1 SOF(Start Of Frame)封包9 2.5.4.2 IN封包10 2.5.4.3 OUT封包11 2.5.4.4 SETUP封包11 2.5.4.5 Handshake封包12 2.5.5 USB傳輸類型13 2.5.5.1 控制傳輸(Control Transfer)13 2.5.5.2 巨量傳輸(Bulk Transfer)13 2.5.5.3 中斷傳輸(Interrupt Transfer)14 2.5.5.4 等時傳輸(Isochronous Transfer)14 第三章 Cypress EZ-USB FX2 Soc15 3.1 EZ-USB FX2晶片特性15 3.2 EZ-USB FX2架構15 3.3 EZ-USB FX2 8051微處理器17 3.4 EZ-USB FX2 SIE(Serial Interface Engine)17 3.5 EZ-USB FX2重新列舉(Re-enumeration)18 3.6 EZ-USB FX2端點(Endpoint)18 3.7 EZ-USB FX2外部FIFO 介面19 3.8 EZ-USB FX2的啟動21 3.9 EZ-USB FX2記憶體21 3.10 EZ-USB FX2中斷22 第四章 測試平台系統25 4.1 硬體架構25 4.1.1 FX2-56核心單板25 4.1.1.1 Slave FIFO基礎知識27 4.1.1.2 同步Slave FIFO寫入29 4.1.1.3 同步Slave FIFO讀取31 4.1.1.4 非同步Slave FIFO寫入33 4.1.1.5 非同步Slave FIFO讀取34 4.1.2 複雜型可程式規劃邏輯元件 : CPLD EPM570(Altera)36 4.1.3 FIFO記憶體 : IDT7205(IDT)37 4.2 韌體程式設計38 4.2.1 SDCC(Small Device C Compiler)39 4.2.2 端點暫存器39 4.2.3 端點記憶體40 4.2.4 Auto-In / Auto-Out 模式41 4.2.5 AUTOOUT = 1模式,EZ-USB FX2存取OUT封包42 4.2.6 AUTOOUT = 0模式,EZ-USB FX2存取OUT封包43 4.2.7 AUTOIN = 1模式,EZ-USB FX2存取IN封包45 4.2.8 AUTOIN = 0模式,EZ-USB FX2存取IN封包47 第五章 測試平台驗證49 5.1 韌體開發流程圖50 5.2 基礎函式庫(Cyfx2.lib)的編譯50 5.3 建立新韌體(Vendor-specific Command, Vnd_Cmd)52 5.4 Vnd_Cmd韌體下載與驗證55 5.5 建立新韌體(EZ-USB Data Acquisition, EZDAQ)57 5.6 EZDAQ韌體下載與驗證62 第六章 結論及未來研究方向65 參考文獻66

    [1] Universal Serial Bus Revision 2.0 specification,
    http://www.usb.org/developers/docs/
    [2] USB Wiki, http://en.wikipedia.org/wiki/USB
    [3] CY7C68013A Datasheets, http://www.cypress.com/?rID=14181
    [4] EZ-USB Technical Reference Manual,
    http://www.cypress.com/?rID=14667
    [5] Cypress Knowledge Base,
    http://www.cypress.com/?id=4&rtID=118&source=header
    [6] 許永和,USB2.0高速週邊裝置設計之實務應用,全華科技圖書公司,95年12月
    [7] Bi Bo, Sun Shuying and Wang Chunping,“Design of Data Acquisition Equipment Based on USB”, Electronic Measurement and Instruments, ICEMI '07. 8th International Conference. pp.1-866 - 1-869, 2007
    [8] USB in a NutShell, http://www.beyondlogic.org/usbnutshell/usb1.htm
    [9] SDCC Manual, http://sdcc.sourceforge.net/doc/sdccman.pdf
    [10] 8051 Microcontroller Instruction Set,
    http://www.atmel.com/dyn/resources/prod_documents/doc0509.pdf
    [11] 8051 Microcontrollers Hardware Manual,
    http://www.atmel.com/dyn/resources/prod_documents/doc4316.pdf
    [12] C51 Application Notes, http://www.keil.com/appnotes/list/c51.htm
    [13] Open OpenUSB project, http://sourceforge.net/projects/openusb/
    [14] Linux USB Project, http://www.linux-usb.org/
    [15] Programming Guide for Linux USB Device Drivers,
    http://www.lrr.in.tum.de/Par/arch/usb/usbdoc/
    [16] Jan Axelson,“USB Complete: Everything You Need to Develop Custom USB Peripherals”,
    http://books.google.com.tw/books?id=OSnynlQrvVcC&printsec=frontcover
    [17] D. Delorie,“Easy R8C/M16C/M32C Flash Programming”, 2008,
    http://people.redhat.com/dj/m32c/flash-guide.pdf
    [18] D. Delorie,“USB GPIO Project Page”,
    www.delorie.com/electronics/usb-gpio
    [19] D. Delorie,“Construct a USB GPIO Pod (Part 1)”, Circuit Cellar Maagzine, pp.16-23, April.2009
    [20] D. Delorie,“Construct a USB GPIO Pod (Part 2)”, Circuit Cellar Maagzine, pp.24-45, May.2009
    [21] FIFO memory chip, IDT7205 datasheets
    http://www.idt.com/products/getDoc.cfm?docID=18694116

    QR CODE