【正文】
I 摘 要 頻率計作為一件很普遍的的電子器件,在很多領域都能夠用到,目前大部分頻率計的測頻范圍都很窄,有時不能滿足所要測的頻率。因此,本文提出寬頻帶頻率計的的設計方案,以單片機 AT89C52 為控制核心,實現(xiàn)測量多種波形的頻率值。 采用在高頻段直接測頻法,在低頻段測周期法的設計思路;硬件部分由放大電路、波形變換和整形電路、閘門時基控制電路、分頻電路、單片機和數(shù)據(jù)顯示電路組成;軟件部分由信號頻率測量模塊、周期測量模塊、定時器中 斷服務模塊、數(shù)據(jù)顯示模塊等功能模塊實現(xiàn)。應用單片機的控制功能和數(shù)學運算能力,實現(xiàn)計數(shù)功能和頻率、周期的換算。設計的頻率計測量范圍能夠達到 2HZ~ 1MHZ,滿足所要求的頻率范圍,測量精度較高,平均相對誤差低。 關鍵詞 : AT89C52;寬頻帶;頻率計 ABSTRACT As a very mon electronic ponents, The frequency meter is used in many areas. At present, most of the frequency meter measuring frequency range is very narrow, and sometimes it can39。t satisfy the frequency of the measure. Therefore, this paper puts forward the frequency meter wide band to realize the value of measurement frequency wave. This design is going to make the AT89C52 single chip microputer as control core. The high frequency band in direct frequency measurement method, at low frequency measurement cycle method of design thinking is to adopted。 Hardware consists of amplifying circuit, wave transform and plastic circuit, gate, and the control circuit, points frequency circuit, SCM and data display circuit posed。 Software is realized by the signal frequency measurement modules, cycle measurement modules, timer interrupt service module, data showed module and function modules. Application of the single chip microputer control function and mathematical operation ability can realize the count function and frequency of the conversion, period. The frequency of the design plan measurement range can reach 2 HZ ~ 1 MHZ, meeting the required frequency range, high measurement precision, the average relative error low. Keywords: AT89C52。 Broadband belt。 Frequency meter II 目 錄 1 緒論 ........................................................................................................................................... 1 課題的引入 ......................................................................................................................... 1 背景 ....................................................................................................................................... 1 目的及意義 ......................................................................................................................... 1 2 頻率計總體方案設計 .......................................................................................................... 2 總體設計方案 ..................................................................................................................... 2 測量方法分析 ..................................................................................................................... 4 直接 測頻法 ...................................................................................................................... 4 間接測量法(測周期法) .......................................................................................... 4 直接與間接相結(jié)合的方法 .......................................................................................... 5 3 系統(tǒng)硬件設計 ........................................................................................................................ 6 信號預處理電路 ................................................................................................................ 6 放大電路 ........................................................................................................................... 6 波形變換和整形電路 ................................................................................................... 7 閘門時基電路 ................................................................................................................. 8 分頻電路 ........................................................................................................................... 9 最小系統(tǒng) .............................................................................................................................11 AT89C52 ............................................................................................................................11 復位電路 ......................................................................................................................... 13 晶振電路 ......................................................................................................................... 14 顯 示電路 ............................................................................................................................ 14 總電路圖 ............................................................................................................................ 17 4 系統(tǒng)軟件設計 ...................................................................................................................... 18 直接頻率測量模塊 ......................................................................................................... 18 信號周期測量模塊 ......................................................................................................... 19 定時器中斷服務模塊 ..................................................................................................... 20 多進制二進制數(shù)轉(zhuǎn)換為 BCD 碼模塊 .......................................................................... 21 相關子模塊 ....................................................................................................................... 22 LED 動態(tài)顯示模塊 ........................................................................................................ 22 源程序 ................................................................................................................................. 23 5 仿真和調(diào)試 ........................................................................................................................... 24 硬件的仿真 ......................................................................................................................... 24 軟件的調(diào)試 ......................