【正文】
部分未做深入分析,如果要做實(shí)際應(yīng)用,該電路部分還需進(jìn)一步研究。(11) FC 為自校頻率,取自單片機(jī)的外接晶振。 (8) SS0, SS1:計(jì)數(shù)位讀出選通控制。 (5) AS:自校和測(cè)頻選擇。CS=0 時(shí),等精度測(cè)頻。利用 AT89C51 的 PO 口讀計(jì)數(shù)器COUNT 輸出 B[7..0]標(biāo)準(zhǔn)頻率信號(hào)的值,P2 口讀計(jì)數(shù)器 COUNT 輸出 B[15. . 8]被測(cè)信號(hào)的值。當(dāng) P3 口寫入 ’1’后,被內(nèi)部上拉為高電平,并用作輸入。 P1 口管腳寫入’1’后,被內(nèi)部上拉為高,可用作輸入。當(dāng) P1 口的管腳輸入數(shù)據(jù)時(shí),應(yīng)先把口置’1’。低電壓,高性能 CMOS 結(jié)構(gòu)的 8 位單片機(jī)。 (5) 由單片機(jī)讀出計(jì)數(shù)器 CNT2 的結(jié)果,并通過上述測(cè)量原理公式計(jì)算出脈沖寬度。 (2)測(cè)量脈沖寬度的工作步驟(1) 向 CONTRL2 的 CLR 端送一個(gè)脈沖以便進(jìn)行電路的工作狀態(tài)初始化。139。 如果 CLR 輸入高電平則 (2)輸出低電平ELSIF B039。 PROCESS(B0, CLR) IS BEGINIF CLR=39。 THEN (2)=39。039。 END PROCESS。139。 THEN (1)=39。 將 F2 和 (1)的數(shù)據(jù)相與再賦給 A0 B0=NOT A0。039。 否則 PUL 輸出低電平END IF。 IF S=2 THEN PUL=39。139。 SIGNAL S: STD_LOGIC_VECTOR(1 DOWNTO 0)。 ENDD, PUL: OUT STD_LOGIC)。 h2 [3]圖 38 測(cè)脈寬、占空比控制模塊原理圖測(cè)脈寬、占空比控制模塊 LIBRARY IEEE。 4 脈沖寬度測(cè)量和占空比測(cè)量模塊設(shè)計(jì) (1)脈沖寬度測(cè)量原理圖東華理工大學(xué)畢業(yè)設(shè)計(jì)(論文) 硬件電路設(shè)計(jì)13根據(jù)脈寬測(cè)量原理,設(shè)計(jì)如圖 38(CONTRL2)所示的電路原理示意圖01DENAQPRECLR A[2..0]B[2..0]OUTEQUALA[2..0]B[2..0]OUTEQUALDENAQPRECLRDENAQPRECLR111Equal1139。 END IF。 利用 IF 語句確定 CNT 的數(shù)據(jù)ELSIF CLK39。 ARCHITECTURE ART OF CNT IS SIGNAL CNT: STD_LOGIC_VECTOR(31 DOWNTO 0)。 USE 。DENAQPRECLRCLK2~0FINCLK1EENDCLK2STARTFSDCLRCLRCCLK1~01圖 35 測(cè)頻與測(cè)周期控制部分電路3 計(jì)數(shù)部件設(shè)計(jì)圖 36 計(jì)數(shù)部件模塊圖東華理工大學(xué)畢業(yè)設(shè)計(jì)(論文) 硬件電路設(shè)計(jì)12A[31..0]B[31..0] OUT[31..0]ADDERD QPREENACLRCLKCLRQ[31..0]CNT[31..0]Add03239。 (2) 由預(yù)置門控信號(hào)將 CONTRL 的 START 端置高電平,預(yù)置門開始定時(shí),此時(shí)由被測(cè)信號(hào)的上沿打開計(jì)數(shù)器 CNT1 進(jìn)行計(jì)數(shù),同時(shí)使標(biāo)準(zhǔn)頻率信號(hào)進(jìn)入計(jì)數(shù)器 CNT2。利用此功能可分別獲得脈寬和占空比數(shù)據(jù)。 (2) CLR/TRIG():當(dāng) TF=0 時(shí)系統(tǒng)全清零功能;當(dāng) TF=1 時(shí) CLRTRIG的上跳沿將啟動(dòng) CNT2,進(jìn)行脈寬測(cè)試計(jì)數(shù)。(2) 7 個(gè) LED 數(shù)碼管組成測(cè)量數(shù)據(jù)顯示器,另一個(gè)獨(dú)立的數(shù)碼管用于狀態(tài)顯示??紤]到提高單片機(jī) I/O 口的利用率,降低編程復(fù)雜性,提高單片機(jī)的計(jì)算速度以及降低數(shù)碼顯示器對(duì)主系統(tǒng)的干擾,可以采用串行靜態(tài)顯示方式。東華理工大學(xué)畢業(yè)設(shè)計(jì)(論文) 硬件電路設(shè)計(jì)9(5)鍵盤模塊。用于控制 FPGA 的測(cè)頻操作和讀取測(cè)頻數(shù)據(jù),并作出相應(yīng)數(shù)據(jù)處理。用于對(duì)待側(cè)信號(hào)進(jìn)行放大和整形,以便作為 PLD 器件的屬于信號(hào)。 COMPONENT CONTRL IS 測(cè)頻、周期控制模塊例化PORT(FIN, START, CLR, FSD: IN STD_LOGIC。 END ENTITY DJDPLJ。 SEL: IN STD_LOGIC_VECTOR(2 DOWNTO 0)。 USE 。 等精度數(shù)字頻率計(jì)項(xiàng)目設(shè)計(jì)方案 等精度數(shù)字頻率計(jì)的設(shè)計(jì)等精度數(shù)字頻率計(jì)涉及到的計(jì)算包括加、減、乘、除,耗用的資源比較大,用一般中小規(guī)模 CPLD/FPGA 芯片難以實(shí)現(xiàn)。EPM7128SLC8415 包含 128 個(gè)宏單元,每 16 個(gè)宏單元組成一個(gè)邏輯陣列塊,同時(shí),每個(gè)宏單元有一個(gè)可編程的“與”陣和固定的“或”陣,以及一個(gè)具有獨(dú)立可編程時(shí)鐘、時(shí)鐘使能、清除和置位功能的可配置觸發(fā)器。 該測(cè)頻系統(tǒng)選用的 CPLD 器件是 ALTERA 公司所生產(chǎn)的 MAX 7000 系列中的EPM7128SLC8415。(3) 測(cè)頻標(biāo)準(zhǔn)頻率 50MHz 信號(hào)由晶體振蕩源電路提供。P2 口為雙向控制口。因此,我們選擇單片機(jī)和CPLD/FPGA 的結(jié)合來實(shí)現(xiàn)。 (2) 對(duì)于周期測(cè)試功能,信號(hào)測(cè)試范圍與精度要求與測(cè)頻功能相同。(2)增大 Tpr或 fs可以增大 Ns,減少測(cè)量誤差,提高測(cè)量精度。當(dāng)預(yù)置門信號(hào)為低電平時(shí)。輸 入 通 道 閘 門 A 計(jì) 數(shù) 器 A顯 示運(yùn) 算 器控 制 電 路時(shí) 基 分 頻 閘 門 B 計(jì) 數(shù) 器 Bf xf 0圖 21 等精度測(cè)量原理圖 由此可見,多周期同步法測(cè)頻技術(shù)的實(shí)際閘門時(shí)間 Tr不是固定的值,而是被測(cè)信號(hào)周期的整數(shù)倍,計(jì)數(shù)器 A 的計(jì)數(shù)脈沖與閘門 A 的開、閉是完全同步的,因而不存在+1 個(gè) 等精度測(cè)量原理 東華理工大學(xué)畢業(yè)設(shè)計(jì)(論文) 總體設(shè)計(jì)思路 4圖 22 等精度數(shù)字頻率計(jì)原理圖 在圖中,預(yù)置門控信號(hào)是寬度為 Tpr的一個(gè)脈沖,CNT1 和 CNT2 是兩個(gè)可控的計(jì)數(shù)器。多周期同步測(cè)量原理框圖如圖 11 所示。這種測(cè)量方式的精度隨被測(cè)信號(hào)頻率的變化而變化。CPLD 芯片采用流行的 VHDL 語言編程,并在 Quartus II 設(shè)計(jì)平臺(tái)上實(shí)現(xiàn)了全部編程設(shè)計(jì),單片機(jī)采用底層匯編語言編程,可以精確地控制測(cè)頻計(jì)數(shù)閘門的開東華理工大學(xué)畢業(yè)設(shè)計(jì)(論文) 緒論2啟和關(guān)閉,從而進(jìn)一步提高了測(cè)量精度。而且隨著小數(shù)點(diǎn)后面數(shù)字的不斷增多,對(duì)被測(cè)信號(hào)的精度的要求也隨之提高。高精度的測(cè)頻儀和頻率發(fā)生器有著廣泛的市場(chǎng)前景。這兩種方法的測(cè)量精度不固定,與被測(cè)信號(hào)的范圍相關(guān)。關(guān)鍵詞 等精度測(cè)量; 單片機(jī); 頻率計(jì); 閘門時(shí)間東華理工大學(xué)畢業(yè)設(shè)計(jì)(論文) ABSTRACTIIABSTRACT In the field of electronic measurement, the frequency checking is one of mostfundamental and critically important measuring methods. Because frequency signal, whichis easily transported, has strong resistance to the disturbance and can be measured withhigh precision, research on the method by measuring frequency have more and moresignificance in the real application.Along with is measured based on the traditional frequency measurement principle frequency meter measuring accuracy the signalling frequency the drop but to reduce, in is practical has the very big limitation, but and so on the precision frequency meter not only has teaches the high measuring accuracy, moreover maintains the constant test precision in the entire frequency measurement region. Using and so on the precision survey principle, unified the monolithic integrated circuit technical design one kind of numeral frequency meter, because has used the shield actuation electric circuit and technical measure and so on digital average value filter, thus could in pared in the frequency range and the scope scope which the width decided to the frequency, the cycle, the pulse width, occupied parameter and so on spatial ratio carries on the survey, and might through the adjustment strobe time initialization measuring accuracy. Selection this kind of synthesis measured the mensuration took the digital frequency meter the survey algorithm, proposed based on the CPLD digital frequency meter design proposal. Has produced this design proposal actual survey effect, proved this design proposal is practical and feasible, can achieve the high frequency measurement precision. During the design, a chip EPM7128SLC84_1 S in CPLD fulfills timing logic control and count function. Under the flat of Quartus II,through VHDL language CPLD software design } pilation } debug, simulation and download can be carried out. By use of the AT89C51 single chip puter as the main controlling parts, the AT89C51 realizes test signal control keyboard scan and output display of LED. The system bines the control flexibility of AT89C51 with programmable performance of CPLD,so not only can it shorten the period of the development and research,but also has the advantages of pact structure little volume high reliability wide scope and high precision.Keywords: Precision survey。 設(shè)計(jì)中用一塊復(fù)雜可編程邏輯器件 CPLD(Complex Programmable Logic Device)芯片 EPM7128SLC8415 完成各種時(shí)序邏輯控制、計(jì)數(shù)功能?;趥鹘y(tǒng)測(cè)頻原理的頻率計(jì)的測(cè)量精度將隨著被測(cè)信號(hào)頻率的下降而降低,在實(shí)用中有很大的局限性,而等精度頻率計(jì)不但有較高的測(cè)量精度,而且在整個(gè)測(cè)頻區(qū)域內(nèi)保持恒定的測(cè)試精度。涉密論文按學(xué)校規(guī)定處理。對(duì)本文的研究做出重要貢獻(xiàn)的