【正文】
中文題目:基于 CPLD 和單片機(jī)的頻率測量計的設(shè)計 外文題目: THE DESIGN OF FREQUENCY MEASUREMENT BASED ON CPLD AND SINGLE CHIP MICYOCO 畢業(yè)設(shè)計(論文)共 70 頁 圖紙共 2 張 完成日期 20201 年 6 月 答辯日期 20201 年 6 月 摘要 本文主要論述了利用 CPLD 進(jìn)行測頻計數(shù),單片機(jī)實(shí)施控制實(shí)現(xiàn)等精度頻率計的設(shè)計過程。該頻率計利用等精度的設(shè)計方法, 克服了基于傳統(tǒng)測頻原理的頻率計的測量精度隨被測信號頻率的下降而降低的缺點(diǎn)。等精度的測量方法不但具有較高的測量精度,而且在整個頻率區(qū)域保持恒定的測試精度。該頻率計利用 CPLD 來實(shí)現(xiàn)頻率的測量計數(shù)。利用單片機(jī)完成整個測量電路的測試控制、數(shù)據(jù)處理和顯示輸出。 本文詳細(xì)論述了硬件電路的組成和單片機(jī)的軟件控制流程。其中硬件電路包括鍵控制模塊、顯示模塊、輸入信號整形模塊以及單片機(jī)和 CPLD 主控模塊。設(shè)計器件采用 Atmel公司的 單片機(jī) AT89C51 和 Altera 公司的 FPGA 芯片 MAX7000 系列 EPM7128SLC8415。鍵控制模塊設(shè)置 1 個開始鍵和 3 個時間選擇鍵,鍵值的讀入采用一片 74LS165 來完成;顯示模塊用 8 只 74LS164 完成 LED 的串行顯示;被測信號經(jīng)限幅后由兩級直接耦合放大器進(jìn)行放大,再經(jīng)施密特觸發(fā)器整形后輸入 CPLD;標(biāo)準(zhǔn)頻率采用 40MHZ 有源晶振動實(shí)現(xiàn);單片機(jī)軟件用匯編語言編寫,軟件模塊對應(yīng)于硬件電路的每一個部分,還包括部分?jǐn)?shù)據(jù)計算和轉(zhuǎn)換模塊。 關(guān)鍵詞:單片機(jī); CPLD;頻率計;測頻;等精度 Abstract The reach pape rmainly discusses the design process of equalaccuracy frequency meter that uses CPLD to count the frequency measurement and frequency meter is also controled by single chip puter. The frequency meter makes use of equalaccuracy design that can overe the disadvantage of traditional measuring principle, which precision declines as measured signal frequency does. The equalaccuracy measurement not only has higher measuring precision, but also can keep invariable measuring precision in whole area of frequency. This frequency meter uses CPLD to realize the measuring count of frequency. Single chip puter pletes the test control、 data processing and display output of the system. This essay discusses the pose of hardware circuit and software control flow of single chip puter in detail. Hardware circuit includes key control module、 display module, plastic module of input signal、 single chip puter control module and CPLD main control module. The frequency meter adopts single chip puter AT89C51 of Atmel pany and EPM7128SLC8415 of Altera pany. Key control module has 1 function key and 3 time selection key. A chip 74LS165 pletes the key value input. Display module uses eight 74LS165s to realize the serial display of LED. First, the measuring signal amplitude is limited. Second, the single is amplified by two class direct coupling amplifier. Finally, the signal inputs CPLD after it is trimed by Smitter trigger. Standard frequency is 40MHZ. Software program of single chip puter is writed by assembly language. Some of software program is corresponded to every hardware part, the others includ data count and transform. Key Words: SCM。 CPLD。 Frequency meter。 Frequency measurement。 Equalprecision 目錄 摘要 ........................................................... I ABSTRACT ...................................................... II 1 緒論 ........................................................ 1 頻率計基礎(chǔ)知識 ............................................. 1 對靈敏度和準(zhǔn)確度的要求 ................................... 1 測量儀器的準(zhǔn)確度的選擇 ................................... 2 微波計數(shù)器的使用 ........................................ 2 技術(shù)背景及發(fā)展趨勢 ......................................... 3 EDA 技術(shù)的發(fā)展及其應(yīng)用 ..................................... 4 單片機(jī)概論 ................................................. 5 頻率計的設(shè)計內(nèi)容和意義 ..................................... 6 2 設(shè)計理論基礎(chǔ) ................................................ 8 CPLD/FPGA 設(shè)計意義 ......................................... 8 EDA ..................................................... 8 CPLD(復(fù)雜可編程邏輯器件 )................................. 8 FPGA(現(xiàn)場可編程門陣列) ................................. 9 FPGA 和 CPLD 的選擇 ....................................... 9 頻率測量原理 ............................................... 9 頻率測量 ............................................... 10 周期測量 ............................................... 10 等精度測頻法 ........................................... 11 方案設(shè)計 ................................................. 13 基于單片機(jī)的方案 ....................................... 13 基于 CPLD/FPGA 和單片機(jī)相結(jié)合的方案 ...................... 14 方案論證與選擇 ......................................... 15 3 單元模塊設(shè)計 ............................................... 16 系統(tǒng)組成 ................................................. 16 鍵控制模塊 ................................................ 17 串行輸出移位寄存器( 74LS165) ........................... 17 鍵盤電路 ............................................... 18 顯示模塊 ................................................. 19 顯示電路設(shè)計 ........................................... 19 74LS164(串入并出移位寄存器 ) ............................. 21 電源模塊 ................................................. 21 輸入信號整形模塊 .......................................... 22 信號整形電路 ........................................... 22 施密特觸發(fā)器 ........................................... 23 單片機(jī)主控模塊 ............................................ 24 AT89C51 單片機(jī)性能 ...................................... 24 單片機(jī)控制電路 ......................................... 31 測頻模塊的工作原理及設(shè)計 .................................. 32 CPLD 的結(jié)構(gòu)與功能介紹 ................................... 32 CPLD 引腳分布 ........................................... 33 CPLD 模塊邏輯設(shè)計 ....................................... 34 38 其它電路 ................................................. 35 4 軟件設(shè)計 ................................................... 36 MAS+PLUSⅡ概述 ............................................ 36 MAX+PLUSⅡ使用 VHDL 實(shí)現(xiàn)系統(tǒng)功能的全過程 .................... 36 電子系統(tǒng)的設(shè)計方法 ..................................... 36 “自頂向下”與“自底向上”的設(shè)計方法 .................... 37 VHDL 語言簡介 ........................................... 39 頻率計的 VHDL 設(shè)計 ...................................... 39 CPLD 模塊仿真 ............................................. 41 下載驗(yàn)證 ................................................. 41 單片機(jī)的匯編語言編程 ............................