【正文】
較器 輸入電壓 輸入數字量 基于單片機的簡易數字電壓表的設計 4 接接口,片內帶有鎖存功能的 8 路模擬多路開關,可以對 8 路 05V 輸入模擬電壓信號分時進行轉換,由于 ADC0808 設 計時考慮到若干種模 /數變換技術的長處,所以該芯片非常適應于過程控制,微控制器輸入通道的接口電路,智能儀器和機床控制等領域 [5]。 一個 n 位的逐次逼近型 A/D 轉換器只需要比較 n 次,轉換時間只取決于位數和時鐘周期,逐次逼近型 A/D 轉換器轉換速度快,因而在實際中廣泛使用 [1]。硬件電路設計框圖 如圖 1所示。 ⑶ 電壓顯示采用 4 位一體的 LED 數碼管。 ⑶ 電壓顯示用 4位一體的 LED 數碼管顯示,至少能夠顯示兩位小數。 本文是以簡易數字直流電壓表的設計為研究內容,本系統(tǒng)主要包括三大模塊:轉 換模塊、數據處理模塊 及顯示模塊。目前,由各種單片機和 A/D 轉換器構成的數字電壓表作全面深入的了解是很有必要的。 傳統(tǒng)的指針式刻度電壓表功能單一,進度低,容易引起視差和視覺疲勞,因而不 能滿足數字化時代的需要。 基于單片機的簡易數字電壓表的設計 III ADC0808 基于單片機的簡易數字電壓表的設計 IV 目 錄 1 引言 .......................................................................................... 1 2 設計總體方案 .......................................................................... 2 設計要求 ........................................................................... 2 設計思路 .......................................................................... 2 設計方案 .......................................................................... 2 3 硬件 電路設計 .......................................................................... 3 A/D 轉換模塊 ................................................................ 3 單片機系統(tǒng) .................................................................... 7 復位電路和時鐘電路 .................................................... 9 LED 顯示系統(tǒng)設計 ..................................................... 10 總體電路設計 .............................................................. 13 4 程序設計 ................................................................................ 15 程序設計總方案 .......................................................... 15 系統(tǒng)子程序設計 .......................................................... 15 5 仿真 ...................................................................................... 17 軟件調試 ...................................................................... 17 顯示結 果及誤差分析 .................................................. 17 結 論 .......................................................................................... 20 參考文獻 .................................................................................... 21 附錄 程序代碼 .......................................................................... 22 基于單片機的簡易數字電壓表的設計 V 致謝 ........................................................................................... 25 基于單片機的簡易數字電壓表的設計 1 1 引言 在電量的測量中,電壓、電流和頻率是最基本的三個被測量,其中電壓量的測量最為經常。 關鍵詞 單片機; 數字電壓表 ; A/D 轉換; AT89C51; ADC0809 基于單片機的簡易數字電壓表的設計 II Design of Simple Digital Voltmeter Based on Singlechip Microcontroller Tian Mingming Abstract This paper which introduces a kind of simple digital voltmeter is based on singlechip microcontroller design. The circuit of the voltage meter is mainly consisted of three mould pieces: A/D converting mould piece, A/D converting is mainly pleted by the ADC0808, it converts the collected analog data into the digital data and transmits the oute to the manifestation controlling mould piece. Data processing is mainly pleted by the AT89C51 chip, it processes the data produced by the ADC0808 chip and generates the right manifestation codes, also transmits the codes to the manifestation controlling mould piece. Also, the AT89C51 chip controls the ADC0808 chip to work. The voltmeter features in simple electrical circuit, lower use of elements, low cost, moreover, its measuring precision and reliability. The voltmeter is capable of measuring voltage inputs from 1 route ranging from 0 to 5 volt, and displaying the measurements thou