【正文】
xx 大學(xué)學(xué)士學(xué)位論文 3 一個數(shù)字信號處理系統(tǒng)是電子技術(shù)、信號處理技術(shù)和計算機技術(shù)相結(jié)合的產(chǎn)物,系統(tǒng)設(shè)計通常分為信號處理部分和非信號處理部分。 USB 接 口 支 持 ( 低 速 )、 12MB/S( 全速 ) 和高達480MB/S( 規(guī)范 )的數(shù)據(jù)傳輸速率,扣除用于總線狀態(tài)、控制和錯誤監(jiān)測 xx 大學(xué)學(xué)士學(xué)位論文 2 等數(shù)據(jù)傳輸, USB 的最大理論傳輸速率仍達 ,遠高于一般的串行總線接口。由于 DSP 具有豐富的硬件資源,改進的并行結(jié)構(gòu)、告訴數(shù)據(jù)處 理能力和強大的指令系統(tǒng),它已經(jīng)成為世界半導(dǎo)體產(chǎn)業(yè)中緊隨微處理器與微控制器之后的又一個熱點,在通信、航空、航天、國防、工業(yè)控制、網(wǎng)絡(luò)及家用電器領(lǐng)域得到了廣泛的應(yīng)用。 關(guān)鍵詞 數(shù)字信號處理器 ; 數(shù)據(jù)采集 ; USB xx 大學(xué)學(xué)士學(xué)位論文 II The Design of Data Acquisition System Based on DSP Abstract With the rapid development of puter and information technology, Digital signal processing technology has been more and mole important in highspeed and realtime is widely used in graph and image processing, voice identification,intelligent checking,industry control and other lot of reatimedata acquisition and processing systems choose DSP(Difital Signal Processor)as hiscore processor,which ask for dealing with the collecting image data this paper,we proposed a highspeed data collection system based on the digital signal solved a lor of technology problems and difficulties in the system design and implement way of all kinds of function units is also introduced and analyzed in this paper. The data acquisition and processing system pletes acquisition and processing to the analog signals and control of the machine using the chip of this chip has abundant of peripheral,we can have a simple circuit architecture,a lowcost and a short development time by using choose USB(Universal Serial Bus) as the munication interface of DSP and the puter which can fulfill up datatransfer and the control to acquisitioned and processed data is transferred to PC through the USB and dealed with by the top software. According to the system’s need,we choose the analog to digital unit inside DSP asthe system’s through the pare of two design themes,which is proved to meet theneed of the system totally through the results of methods are also bringedforward to improve to the precision of the internal A/D converter and remove theelectric ,we use simultaneous sampling mode and cascadedsequencer mode to improve the acquisition and convert speed. As for the order of electrifying for core professorTMS320F2812,it’s CPU is electrified earlier than the I/O peripherals which is different from at thisproblem,a power supply design method has been brought forward,which solves theorder of the large amount of image data that requires to be processed,the inter memory resources of F2812 can’t meet the for this point,this theme extends the outside memory according to the internal memory characters of the DSP chip. In addition,this theme gives the flow chart of the main program and the detail methods about the system’s software design and implement,including system’s initialization,data acquisition,analog to digital converter unit,data processing,data munication and code development flow of USB firmware is also introduced in this theme. Key words DSP。采集到的數(shù)據(jù)經(jīng)過 DSP 的處理后,通過 USB 上傳到 PC,由上層軟件進行進一步的處理。很多要求對快速處理的實時數(shù)據(jù)采集處理系統(tǒng),選用 DSP(數(shù)字信號處理器 )作為核心處理器。在采集速度方面,系 統(tǒng)采用級聯(lián)同步采樣方式對信號進行采集,采集轉(zhuǎn)換速度可以大大提高。 20 世紀 60 年代以來,數(shù)字信號處理器 (Digital Signal Processing,DSP)日漸成為一項成熟的技術(shù) ,并在多項應(yīng)用領(lǐng)域逐漸替代了傳統(tǒng)模擬信號處理系統(tǒng) .傳統(tǒng)的信號處理系統(tǒng)采用模擬技術(shù)進行設(shè)計和分析,處理設(shè)備和控制器采用模擬器件實現(xiàn) .與之相比,數(shù)字信號處理技術(shù)與設(shè)備具有靈活、精確、抗干擾能力強、設(shè)備尺寸小、速度快、性能穩(wěn)定和易于升級等優(yōu)點 ,所以目前大多設(shè)備采用數(shù)字技術(shù)設(shè)計實現(xiàn) [1]。 USB 是一些 PC 大廠商如 Microsoft、 Intel等為了結(jié)局日益增加的 PC外設(shè)與有限的主板插槽和 端口之間的矛盾而制定的一種串行通信的標準,自1995 年在 Comdex 上亮相以來至今廣泛地為各 PC 廠家所支持。 圖 11 典型的 DSP 應(yīng)用系統(tǒng) 輸入信號首先進行帶限濾波抽樣,然后進行 AD 轉(zhuǎn)換把模擬信號變換成數(shù)字信號。系統(tǒng)的軟件和硬件分別調(diào)試完成后,就可以將軟件脫離開發(fā)系統(tǒng)而直接在應(yīng)用系統(tǒng)上運行。 4 . 在 TI 公司的 Code Composer Studio for C20xx ( ccs )下對TMS320F2812 進行軟件仿真,熟悉 CCS 的開發(fā)環(huán)境,在內(nèi)部 進行一些算法調(diào)試工作。 根據(jù)設(shè)計要求,結(jié)合目前市場使用情況,本系統(tǒng)選用 TI 公司新近推出的專門用于控制領(lǐng)域的 TMS320F2812。該系統(tǒng)要求采樣的精度到 8位數(shù)字量,用 F2812 自帶的 ADC 模塊就可達到很好的效果,省去了專用的ADC 芯片,使系統(tǒng)的時序控制變得簡單,從而降低了系統(tǒng)的復(fù)雜性,也節(jié)約了成本 。 DSP 芯片是實現(xiàn)數(shù)字信號處理技術(shù)的硬件支持,是數(shù)字信號處理技術(shù)與數(shù)字信號處理應(yīng)用之間的橋梁和紐帶,隨著全球集成電路事業(yè)的發(fā)展,美國的 TI 公司成為世界上最大的 DSP 芯片供應(yīng)商,其 DSP 市場份額占全世界份額近 50%,其 DSP 產(chǎn)品根據(jù)功 能氛 圍三個 系列 TMS320C20xx 系 列, TMS320C5000 系列,TMS320C6000 系列,本系統(tǒng)選用的就是 TI 的 20xx 系列的 TMS320F2812 芯片。在改進的哈佛結(jié)構(gòu)的基礎(chǔ)上,大多數(shù) DSP 芯片又引入了流水線操作以減少每條指令的執(zhí)行時間,從而進一步增強處理器的楚劇處理能力。目前 C64 DSP 高速時鐘已達 。 3. 存儲空間: 18k 16 位 0 等待周期片上 SRAM 和 128K 16 位片上FLASH(存儲時間 36ns); 3 個獨立的片選信號,最多 1MB 的尋址空間。它帶有倆個 8 選 1 多 路切換器和雙采樣 /保持器的 12 位的、具有流水線結(jié)構(gòu)的模數(shù)轉(zhuǎn)換器。 USB 總線接口具有熱插拔、速度快(包括低、中、高模式)和外設(shè)容量大(理論上可掛接 127 個設(shè)備)、支持即插即用( Plugamp。 為了減小硬件設(shè)計的復(fù)雜度,加快系統(tǒng)的開發(fā)速度,上位機與板卡的接口器件選用 Cypress 公司 EZUSB FX2 系列中的 CY7C68013A(下面簡稱68013)。許多 DSP 都提供了具備片內(nèi) ROM 型的產(chǎn)品,片內(nèi) ROM 可以將定型的程序代碼固化到 DSP 片內(nèi),從而減少了系統(tǒng)的體積、功耗、電磁輻射干擾,速度也有所提高,當大批量生產(chǎn)可以降低成本。因此,選擇外部存儲器時,應(yīng)使設(shè)計中模塊的數(shù)目盡可能的大。一種是前端外擴一個專 用的模數(shù)轉(zhuǎn)換芯片 [20],比如外擴一片 ADS8364,采樣精度可達到 16 位;另外一種是直接應(yīng)用 F2812 的 ADC 模塊,由于芯片自身的一些限制, AD 轉(zhuǎn)換的精度最多只能達到 12 位。另外,在 REFIN 和 REFOUT 引腳內(nèi)部還帶有 +參考電壓以及高速并 行接口。另外,通過 /RD 和 /CS 為低電平可使數(shù)據(jù)讀出到并行輸出總線。自動排序器允許對同一個通道進行多次采集,用戶可以完成采樣算法,這樣可以獲得更高的采樣精度。 7. 16 個結(jié)果寄存器(可獨立尋址)存放 ADC 的轉(zhuǎn)換結(jié)果,轉(zhuǎn)換后的數(shù)字量表示為:數(shù)字值 =4095 {(輸入模擬電壓值 — ADCLO) 247。 xx 大學(xué)學(xué)士學(xué)位論文 15 0 0 . 5 1 1 . 5 2 2 . 5 30 . 511 . 522 . 53— — — — 理 論 值— — — C H 3 圖 33 DSP 自帶 ADC 采樣與理論值的比較圖(輸 入電壓 0~3V) DSP 的外圍電路設(shè)計 電源電路 本系統(tǒng) 中用到了 5V、 和 的器件,還需要 12V 的電壓驅(qū)動電機,F(xiàn)2812 采用 的外設(shè)供電和 的內(nèi)核供電, 68013 采用 供電,本系統(tǒng)采用 TI 公司的芯片 TPS75733 和 TPS76081,將電路板外接的 +5V 轉(zhuǎn)換成+ 和 ,電源輸出 +12V, +5V 和 — 5V 的電壓。 電源電路設(shè)計時要注意數(shù)字地和模擬地分開,系統(tǒng)設(shè)計中用 600R 100MHz 1A 的磁珠將兩者分開,避免公共地阻抗對模擬信號和數(shù)字信號產(chǎn)生耦合作用。而選用第一種晶振操作模 xx 大學(xué)學(xué)士學(xué)位論文 17 式,可以將一個較低的外部時鐘源通過內(nèi)部倍頻的手段達到 DSP 的工作頻率,PLL 的倍頻因子由 PLLCR 寄存器的 3, 2, 1, 0 位決定,如表 31 所示 ,OSCCLK 是晶振頻率 。系統(tǒng)的時鐘電路如圖 35 所示。作為硬件復(fù)位的一部分,所有當前操作均被放棄,流水線被清除, CPU 的寄存器 都進行復(fù)位,然后復(fù)位中斷向量被取回,從而執(zhí)行相應(yīng)的中斷服務(wù)程序。 一般情況下,在系統(tǒng)成功應(yīng)用之前,我們要做大量的調(diào)試工作,以確保板卡和軟件程序正常工作,為了方便軟件調(diào)試, JTAG 接口尤為重要,只有 JTAG接口設(shè)置好,才能通過仿真器被 CCS 識別,從而進行大量的訪真測試實驗。為了提高執(zhí)行速度,本文設(shè)計的系統(tǒng)在調(diào)試時將程序空間映射到內(nèi)部空間中。 F2812 還包含一塊 16K 16 位的單周期訪 問的 RAM 存儲器 xx 大學(xué)學(xué)士學(xué)位論文 21 ( SRAM),這部分存儲器被分為 3 塊,分別是 L0( 4K), L1 ( 4K), H0(