【正文】
腳保持高電平, 51 芯片便循環(huán)復(fù)位。 (7) 低功耗的閑置和掉電模式 。 AT89C51 單片機(jī)為很多嵌入式控制系統(tǒng)提供了一種靈活性高且價(jià)廉的方案。單片機(jī)的 P 端口作為四位 LED 數(shù)碼管現(xiàn)實(shí)控制。 圖 31 電路原理圖 2020屆本科課程設(shè)計(jì) 4 設(shè)計(jì)過(guò)程 簡(jiǎn)易數(shù)字電壓測(cè)量電路由 A/D 轉(zhuǎn)換、數(shù)據(jù)處理及顯示控制等組成。通過(guò)按鍵選擇可對(duì) 8 路循環(huán)顯示,也可單路顯示,單路顯示可通過(guò)按鍵選擇顯示的通道數(shù)。 本設(shè)計(jì) AT89C51 單片機(jī)的一種電壓測(cè)量電路 ,該電路采用 ADC0808 本文介紹一種基于 A/D 轉(zhuǎn)換電路,測(cè)量范圍直流 0~ 5V 的 4 路輸入電壓值,并在四位LED 數(shù)碼管上顯示或單路選擇顯示。 關(guān)鍵詞: 數(shù)字電壓表; AT89C51 單片機(jī);高精度 2020屆本科課程設(shè)計(jì) 4 Abstract The basic working principle of digital voltmeter is an analog signal by A/D conversion circuit to be measured is converted into digital signal, through the corresponding conversion will test a voltmeter results displayed in digital form. Compared with the general analog voltage meter, digital voltage meter has the advantages of high precision, accurate measurement, visual reading, convenient use etc.. With the development of electronic technology, electronic measuring a large number of electronic workers must master the means, the measurement accuracy and functional requirements are increasingly high, while the voltage measurement is very prominent, because the voltage measurement is most mon. This paper introduces a kind of voltage measurement circuit based on AT89C51 mcu. The circuit uses the high precision, the double integral A/D conversion circuit, the measuring range is 0+5 DC volts, the use of LED digital tube display. The paper briefly introduced the pins and pin function, ADC0808 function and the principle of double integral circuit is introduced, 74LS373 chip, describes the focus of design ideas for a high precision digital voltage meter, analyzed the soft, the hardware circuit of the working principle, design and debugging process, finally has given the detailed test data and analysis. Keywords: digital voltage meter。 第 610天:仿真 /制作。 以 AT89C51 為對(duì)象 ,對(duì)單片機(jī)知識(shí)進(jìn)行梳理,設(shè)計(jì)出快捷精確的數(shù)字電壓表裝置。 三、項(xiàng)目設(shè)計(jì)(研究)思路: 網(wǎng)上查找 資料,熟悉數(shù)字電壓表基本原理和研究方法。 第 1114:編寫(xiě)課程設(shè)計(jì)報(bào)告。 AT89C51 SCM。測(cè)量最小分辨率為 ,測(cè)量誤差約為正負(fù) 。 數(shù)字電壓表的設(shè)計(jì)要求 可以測(cè)量 0~ 5V 范圍內(nèi)的 3 路直流電壓值。電路原理圖見(jiàn)附錄 2。 端口用作單路顯示/循環(huán)顯示轉(zhuǎn)換按鈕, 端口用作單路顯示時(shí)選擇通道。外形及引腳排列如圖 32 所示 。 (8) 片內(nèi)振蕩器和時(shí)鐘電路 。 (4)EA /Vpp(31 引腳 ) 2020屆本科課程設(shè)計(jì) 6 EA為外部程序存儲(chǔ)器訪問(wèn)允許控制 端。在單片機(jī)讀片外程序存儲(chǔ)器時(shí),此引腳輸出脈沖的負(fù)跳沿作為讀片外程序存儲(chǔ)器的選通信號(hào)。 (9)Pin21Pin28 為 輸入輸出腳,稱為 P2 口 。端口置 1 時(shí),內(nèi)部上拉電阻將端口拉到高電平,作輸入用。 (4) ALE:地址鎖存允許信號(hào),高電平有效 。ADC0809 完成一 次轉(zhuǎn)換需 100μ s 左右,它具有輸出 TTL 三態(tài)鎖存緩沖器,可直接連接到 AT89C51 的數(shù)據(jù)總線上。 LED 數(shù)碼管的接口簡(jiǎn)介 LED 的段碼端口 A~ G 分別接至 AT89C51 的 ~ 口,位選端 1~ 4分別接至 、 、 、 ,如圖 37 所示。在中斷程序中包含多路循環(huán)顯示程序和單路顯示程序,多路循環(huán)顯示程序把 4 個(gè)存儲(chǔ)單元的數(shù)值依次取出送到 4 個(gè)數(shù)碼管上顯示,每一路顯示一秒。這就決定了該電壓表的最大分辨率(精度)只能達(dá)到 。 圖 61 仿真時(shí) 的電路圖 2020屆本科課程設(shè)計(jì) 15 7 總結(jié) 經(jīng)過(guò)一周的努力終于 設(shè)計(jì)成功, LED 的顯示結(jié)果和直接用數(shù)字電壓表測(cè)試模擬量輸 入所得結(jié)果幾乎一致,誤差完全在合理的范圍之內(nèi)。存放 相加后的數(shù) MOVX DPTR,A 。進(jìn)行十六進(jìn)制到十進(jìn)制的調(diào)整 ADD A,50H 。顯示第幾路轉(zhuǎn)換電壓子程序 MOV DPTR,TAB1 MOVC A,A+DPTR CLR MOV P1,A LCALL DELAY SETB 2020屆本科課程設(shè)計(jì) 20 RET INTV: PUSH ACC 。進(jìn)行 相加 ADD A,54H DA A MOV R5,A JC L33 SB11:DJNZ R4,L11 MOV A,R5 SWAP A ANL A,0FH MOV B,R1 ADD A,B DA A MOV R1,A SB22:LCALL DISP LCALL DJW JNB ,EXIT 2020屆本科課程設(shè)計(jì) 21 DJNZ R3,SB22 JNB ,CX1 LJMP CX2 L22:CLR C MOV A,R2 ADD A,01H DA A MOV R2,A LJMP SB11 L33:CLR C MOV A,R1 ADD A,01H DA A MOV R1,A LJMP SB11 CX1:INC R7 MOV A,53H INC A MOV 53H,A MOV DPH,51H MOV DPL,52H INC DPTR MOV 51H,DPH MOV 52H,DPL CJNE R7,04H,CX2 MOV R7,00H