【正文】
目 錄1 引言 12 設(shè)計(jì)總體方案 2 2 設(shè)計(jì)思路 2 設(shè)計(jì)方案 23 硬件電路設(shè)計(jì) 3 A/D轉(zhuǎn)換模塊 3 單片機(jī)系統(tǒng) 7 復(fù)位電路和時(shí)鐘電路 9 LED顯示系統(tǒng)設(shè)計(jì) 11 總體電路設(shè)計(jì) 134 程序設(shè)計(jì) 15 程序設(shè)計(jì)總方案 15 系統(tǒng)子程序設(shè)計(jì) 155 仿真 17 軟件調(diào)試 17 顯示結(jié)果及誤差分析 17結(jié) 論 20參考文獻(xiàn) 21附錄 程序代碼 22致謝 25251 引言在電量的測(cè)量中,電壓、電流和頻率是最基本的三個(gè)被測(cè)量,其中電壓量的測(cè)量最為經(jīng)常。 A/D converter。 關(guān)鍵詞 單片機(jī);數(shù)字電壓表;A/D轉(zhuǎn)換;AT89C51;ADC0809 Design of Simple Digital Voltmeter Based on Singlechip Microcontroller Tian MingmingAbstract 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 though a digital code tube of 7 pieces of LED.Keywords Singlechip microcontroller。該系統(tǒng)的數(shù)字電壓表電路簡(jiǎn)單,所用的元件較少,成本低,且測(cè)量精度和可靠性較高。A/D轉(zhuǎn)換主要由芯片ADC0808來(lái)完成,它負(fù)責(zé)把采集到的模擬量轉(zhuǎn)換為相應(yīng)的數(shù)字量在傳送到數(shù)據(jù)處理模塊。 基于單片機(jī)的簡(jiǎn)易數(shù)字電壓表的設(shè)計(jì)基于單片機(jī)的簡(jiǎn)易數(shù)字電壓表的設(shè)計(jì)摘要 本文介紹了一種基于單片機(jī)的簡(jiǎn)易數(shù)字電壓表的設(shè)計(jì)。該設(shè)計(jì)主要由三個(gè)模塊組成:A/D轉(zhuǎn)換模塊,數(shù)據(jù)處理模塊及顯示模塊。數(shù)據(jù)處理則由芯片AT89C51來(lái)完成,其負(fù)責(zé)把ADC0808傳送來(lái)的數(shù)字量經(jīng)過(guò)一定的數(shù)據(jù)處理,產(chǎn)生相應(yīng)的顯示碼送到顯示模塊進(jìn)行顯示;此外,它還控制著ADC0808芯片工作。此數(shù)字電壓表可以測(cè)量05V的1路模擬直流輸入電壓值,并通過(guò)一個(gè)四位一體的7段數(shù)碼管顯示出來(lái)。 Digital voltmeter。 AT89C51。而且隨著電子技術(shù)的發(fā)展,更是經(jīng)常需要測(cè)量高精度的電壓,所以數(shù)字電壓表就成為一種必不可少的測(cè)量?jī)x器。由于數(shù)字式儀器具有讀數(shù)準(zhǔn)確方便、精度高、誤差小、測(cè)量速度快等特而得到廣泛應(yīng)用[1]。采用單片機(jī)的數(shù)字電壓表,將連續(xù)的模擬量如直流電壓轉(zhuǎn)換成不連續(xù)的離散的數(shù)字形式并加以顯示,從而精度高、抗干擾能力強(qiáng),可擴(kuò)展性強(qiáng)、集成方便,還可與PC實(shí)時(shí)通信。以數(shù)字電壓表為核心,可以擴(kuò)展成各種通用數(shù)字儀表、專(zhuān)用數(shù)字儀表及各種非電量的數(shù)字化儀表。最近的幾十年來(lái),隨著半導(dǎo)體技術(shù)、集成電路(IC)和微處理器技術(shù)的發(fā)展,數(shù)字電路和數(shù)字化測(cè)量技術(shù)也有了巨大的進(jìn)步,從而促使了數(shù)字電壓表的快速發(fā)展,并不斷出現(xiàn)新的類(lèi)型[4]。目前,數(shù)字電壓表的內(nèi)部核心部件是A/D轉(zhuǎn)換器,轉(zhuǎn)換的精度很大程度上影響著數(shù)字電壓表的準(zhǔn)確度,因而,以后數(shù)字電壓表的發(fā)展就著眼在高精度和低成本這兩個(gè)方面[3]。其中,A/D轉(zhuǎn)換采用ADC0808對(duì)輸入的模擬信號(hào)進(jìn)行轉(zhuǎn)換,控制核心AT89C51再對(duì)轉(zhuǎn)換的結(jié)果進(jìn)行運(yùn)算處理,最后驅(qū)動(dòng)輸出裝置LED顯示數(shù)字電壓信號(hào)[11]。⑵采用1路模擬量輸入,能夠測(cè)量05V之間的直流電壓值。 ⑷盡量使用較少的元器件。⑵A/D轉(zhuǎn)換采用ADC0808實(shí)現(xiàn),與單片機(jī)的接口為P1口和P2口的高四位引腳。⑷LED數(shù)碼的段碼輸入,由并行端口P0產(chǎn)生:位碼輸入,用并行端口P2低四位產(chǎn)生。 A/D轉(zhuǎn)換電路,AT89C51單片機(jī)系統(tǒng),LED顯示系統(tǒng)、時(shí)鐘電路、復(fù)位電路以及測(cè)量電壓輸入電路。 時(shí)鐘電路 復(fù)位電路A/D轉(zhuǎn)換電路測(cè)量電壓輸入顯示系統(tǒng)AT89C51 P1 P2 P2 P0 圖1 數(shù)字電壓表系統(tǒng)硬件設(shè)計(jì)框圖3 硬件電路設(shè)計(jì) A/D轉(zhuǎn)換模塊現(xiàn)實(shí)世界的物理量都是模擬量,能把模擬量轉(zhuǎn)化成數(shù)字量的器件稱(chēng)為