畢業(yè)設(shè)計(jì)-基于AT89S52單片機(jī)和ADC0809多通道模數(shù)轉(zhuǎn)換的設(shè)計(jì)與實(shí)現(xiàn).docx

上傳人:good****022 文檔編號(hào):116650978 上傳時(shí)間:2022-07-06 格式:DOCX 頁(yè)數(shù):26 大?。?75.57KB
收藏 版權(quán)申訴 舉報(bào) 下載
畢業(yè)設(shè)計(jì)-基于AT89S52單片機(jī)和ADC0809多通道模數(shù)轉(zhuǎn)換的設(shè)計(jì)與實(shí)現(xiàn).docx_第1頁(yè)
第1頁(yè) / 共26頁(yè)
畢業(yè)設(shè)計(jì)-基于AT89S52單片機(jī)和ADC0809多通道模數(shù)轉(zhuǎn)換的設(shè)計(jì)與實(shí)現(xiàn).docx_第2頁(yè)
第2頁(yè) / 共26頁(yè)
畢業(yè)設(shè)計(jì)-基于AT89S52單片機(jī)和ADC0809多通道模數(shù)轉(zhuǎn)換的設(shè)計(jì)與實(shí)現(xiàn).docx_第3頁(yè)
第3頁(yè) / 共26頁(yè)

下載文檔到電腦,查找使用更方便

20 積分

下載資源

還剩頁(yè)未讀,繼續(xù)閱讀

資源描述:

《畢業(yè)設(shè)計(jì)-基于AT89S52單片機(jī)和ADC0809多通道模數(shù)轉(zhuǎn)換的設(shè)計(jì)與實(shí)現(xiàn).docx》由會(huì)員分享,可在線閱讀,更多相關(guān)《畢業(yè)設(shè)計(jì)-基于AT89S52單片機(jī)和ADC0809多通道模數(shù)轉(zhuǎn)換的設(shè)計(jì)與實(shí)現(xiàn).docx(26頁(yè)珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。

1、武漢理工大學(xué)能力拓展訓(xùn)練報(bào)告課程設(shè)計(jì)說(shuō)明書目 錄摘要11、方案設(shè)計(jì)22、硬件電路的設(shè)計(jì)22.1單片機(jī)的最小系統(tǒng)設(shè)計(jì)22.2 ADC0809模數(shù)轉(zhuǎn)換器設(shè)計(jì)電路32.2.1 ADC0809的結(jié)構(gòu)功能32.2.2 ADC0809的工作時(shí)序62.2.3 ADC0809與AT89C52單片機(jī)的接口電路72.3 LCD1602顯示電路82.4 鍵盤與單片機(jī)連接電路102.5系統(tǒng)整體電路圖103、軟件設(shè)計(jì)114、系統(tǒng)仿真和測(cè)試結(jié)果125、性能分析136、心得與體會(huì)147、參考文獻(xiàn)15附錄一:源程序16附錄二:本科生能力拓展訓(xùn)練成績(jī)?cè)u(píng)定表22摘 要本文介紹了基于單片機(jī)的數(shù)據(jù)采集的硬件設(shè)計(jì)和軟件設(shè)計(jì),數(shù)據(jù)采集系

2、統(tǒng)是模擬域與數(shù)字域之間必不可少的紐帶,它的存在具有非常重要的作用。本文介紹的重點(diǎn)是數(shù)據(jù)采集系統(tǒng),而該系統(tǒng)硬件部分的重心在于單片機(jī)。硬件部分是以單片機(jī)為核心,還包括A/D模數(shù)轉(zhuǎn)換模塊,LCD1602顯示模塊部分。8路被測(cè)電壓通過(guò)模數(shù)轉(zhuǎn)換器ADC0809進(jìn)行模數(shù)轉(zhuǎn)換,實(shí)現(xiàn)對(duì)采集到的數(shù)據(jù)進(jìn)行模擬量到數(shù)字量的轉(zhuǎn)換,并將轉(zhuǎn)換后的數(shù)據(jù)通過(guò)LCD1602顯示器來(lái)顯示所采集的結(jié)果,并且可以通過(guò)按鍵來(lái)查看任意通路的電壓值,整個(gè)系統(tǒng)具有操作方便、線路簡(jiǎn)單、測(cè)量誤差小等優(yōu)點(diǎn)。關(guān)鍵詞:?jiǎn)纹瑱C(jī)AT89S52、模數(shù)轉(zhuǎn)換器ADC0809、數(shù)據(jù)采集、LCD1602顯示器1、方案設(shè)計(jì)根據(jù)設(shè)計(jì)要求,采用的方案如下:硬件部分實(shí)現(xiàn)對(duì)

3、8路數(shù)據(jù)采集和顯示的功能,包括MCS-51單片機(jī)、ADC0809、LCD1602;軟件部分實(shí)現(xiàn)單片機(jī)對(duì)8路輸入數(shù)據(jù)的采集以及對(duì)LCD1602的顯示操作。主要設(shè)計(jì)思想:?jiǎn)纹瑱C(jī)P1與ADC0809相連,P0與LCD1602連接。模擬信號(hào)通過(guò)IN0IN7輸入到ADC0809中轉(zhuǎn)換為數(shù)字信號(hào),P1獲得此值后,經(jīng)過(guò)處理得到每位的數(shù)據(jù)后,通過(guò)P0口寫數(shù)據(jù)到LCD屏上。數(shù)據(jù)采集電路的原理框如圖1所示。LCD1602顯示器MCS-51單片機(jī)ADC0809模擬輸入通道1模擬輸入通道2模擬輸入通道8圖1 數(shù)據(jù)采集電路的原理框圖2、硬件電路的設(shè)計(jì)2.1單片機(jī)的最小系統(tǒng)設(shè)計(jì)單片機(jī)最小系統(tǒng)是能補(bǔ)足單片機(jī)工作的最簡(jiǎn)單電路

4、,它由單片機(jī)、電源、晶體振蕩器、復(fù)位電路等構(gòu)成。它是本系統(tǒng)的處理單元也是控制單元,負(fù)責(zé)處理信號(hào)、外設(shè)的接口與控制,同時(shí)它也是所有軟件的載體。本系統(tǒng)采用AT89C52是美國(guó)Atmel公司生產(chǎn)的低電壓、高性能CMOS 8位單片機(jī),片內(nèi)含8KB的可反復(fù)檫寫的程序存儲(chǔ)器和12B的隨機(jī)存取數(shù)據(jù)存儲(chǔ)器(RAM),器件采用Atmel公司的高密度、非易失性存儲(chǔ)技術(shù)生產(chǎn),兼容標(biāo)準(zhǔn)MCS-51指令系統(tǒng),片內(nèi)配置通用8位中央處理器(CPU)和Flash存儲(chǔ)單元,功能強(qiáng)大的AT89C52單片機(jī)可靈活應(yīng)用于各種控制領(lǐng)域。AT89C52單片機(jī)屬于AT89C51單片機(jī)的增強(qiáng)型,與Intel公司的80C52在引腳排列、硬件組

5、成、工作特點(diǎn)和指令系統(tǒng)等方面兼容。主要管腳有:XTAL1(19 腳)和XTAL2(18 腳)為振蕩器輸入輸出端口,外接12MHz 晶振。RST/Vpd(9 腳)為復(fù)位輸入端口,外接電阻電容組成的復(fù)位電路。VCC(40 腳)和VSS(20 腳)為供電端口,分別接+5V電源的正負(fù)端。P0P3 為可編程通用I/O 腳,其功能用途由軟件定義。其管腳如下圖2所示:圖2 AT89C52單片機(jī)管腳圖本設(shè)計(jì)中,P0 端口(3239 腳)被定義為N1 功能控制端口,分別與N1的相應(yīng)功能管腳相連接。單片機(jī)正常工作時(shí),都需要有一個(gè)時(shí)鐘電路和一個(gè)復(fù)位電路。本設(shè)計(jì)中選擇了內(nèi)部時(shí)鐘方式和按鍵電平復(fù)位電路,來(lái)構(gòu)成單片機(jī)的最

6、小電路。如圖3所示。圖3 單片機(jī)最小系統(tǒng)2.2 ADC0809模數(shù)轉(zhuǎn)換器設(shè)計(jì)電路2.2.1 ADC0809的結(jié)構(gòu)功能本數(shù)據(jù)采集系統(tǒng)采用計(jì)算機(jī)作為處理器。電子計(jì)算機(jī)所處理和傳輸?shù)亩际遣贿B續(xù)的數(shù)字信號(hào),而實(shí)際中遇到的大都是連續(xù)變化的模擬量,模擬量經(jīng)傳感器轉(zhuǎn)換成電信號(hào)后,需要模數(shù)轉(zhuǎn)換將其變成數(shù)字信號(hào)才可以輸入到數(shù)字系統(tǒng)中進(jìn)行處理和控制,因此,把模擬量轉(zhuǎn)換成數(shù)字量輸出的接口電路,即AD轉(zhuǎn)換器就是現(xiàn)實(shí)信號(hào)轉(zhuǎn)換的橋梁。目前,世界上有多種類型的AD轉(zhuǎn)換器,如并行比較型、逐次逼近型、積分型等。本文采用逐次逼近型AD轉(zhuǎn)換器,該類AD轉(zhuǎn)換器轉(zhuǎn)換精度高,速度快,價(jià)格適中,是目前種類最多,應(yīng)用最廣的AD轉(zhuǎn)換器。逐次逼

7、近型AD轉(zhuǎn)換器一般由比較器、DA轉(zhuǎn)換器、寄存器、時(shí)鐘發(fā)生器以及控制邏輯電路組成。ADC0809就是一種CMOS單片逐次逼近式AD轉(zhuǎn)換器,其內(nèi)部結(jié)構(gòu)如圖4所示。該芯片由8路模擬開(kāi)關(guān)、地址鎖存與譯碼器、比較器、8位開(kāi)關(guān)樹(shù)型DA轉(zhuǎn)換器、逐次逼近寄存器、三態(tài)輸出鎖存器等電路組成。因此,ADC0809可處理8路模擬量輸入,且有三態(tài)輸出能力。該器件既可與各種微處理器相連,也可單獨(dú)工作。其輸入輸出與TTL兼容。 圖4 ADC0809內(nèi)部結(jié)構(gòu)ADC0809是8路8位AD轉(zhuǎn)換器(即分辨率8位),具有轉(zhuǎn)換啟??刂贫?,轉(zhuǎn)換時(shí)間為100s采用單+5V電源供電,模擬輸入電壓范圍為0+5V,且不需零點(diǎn)和滿刻度校準(zhǔn),工作溫

8、度范圍為-40+85功耗可抵達(dá)約15mW。ADC0809芯片有28條引腳,采用雙列直插式封裝,圖5所示是其引腳排列圖。 圖5 ADC0809的引腳排列圖各引腳的功能如下IN0IN7:8路模擬量輸入端;D0D7:8位數(shù)字量輸出端;ADDA、ADDB、ADDC:3位地址輸入線,用于選通8路模擬輸入中的一路;ALE:地址鎖存允許信號(hào),輸入高電平有效;START:AD轉(zhuǎn)換啟動(dòng)信號(hào),輸入高電平有效;EOC:AD轉(zhuǎn)換結(jié)束信號(hào),輸出當(dāng)AD轉(zhuǎn)換結(jié)束時(shí),此端輸出一個(gè)高電平(轉(zhuǎn)換期間一直為低電平);OE:數(shù)據(jù)輸出允許信號(hào),輸入高電平有效。當(dāng)AD轉(zhuǎn)換結(jié)束時(shí),此端輸入一個(gè)高電平才能打開(kāi)輸出三態(tài)門,輸出為數(shù)字量;CLK

9、:時(shí)鐘脈沖輸入端。要求時(shí)鐘頻率不高640kHz;REF(+)、REF(-):基準(zhǔn)電壓;Vcc:電源,單一+5V;GND:地。ADC0809的工作過(guò)程:首先輸入3位地址,并使ALE=1,將地址存入地址鎖存器中。此地址經(jīng)譯碼選通8路模擬輸入之一到比較器。START上升沿將逐次逼近寄存器復(fù)位。下降沿啟動(dòng) A/D轉(zhuǎn)換,之后EOC輸出信號(hào)變低,指示轉(zhuǎn)換正在進(jìn)行。直到A/D轉(zhuǎn)換完成,EOC變?yōu)楦唠娖?,指示A/D轉(zhuǎn)換結(jié)束,結(jié)果數(shù)據(jù)已存入鎖存器,這個(gè)信號(hào)可用作中斷申請(qǐng)。當(dāng)OE輸入高電平 時(shí),輸出三態(tài)門打開(kāi),轉(zhuǎn)換結(jié)果的數(shù)字量輸出到數(shù)據(jù)總線上。 轉(zhuǎn)換數(shù)據(jù)的傳送 A/D轉(zhuǎn)換后得到的數(shù)據(jù)應(yīng)及時(shí)傳送給單片機(jī)進(jìn)行處理。數(shù)

10、據(jù)傳送的關(guān)鍵問(wèn)題是如何確認(rèn)A/D轉(zhuǎn)換的完成,因?yàn)橹挥写_認(rèn)完成后,才能進(jìn)行傳送。為此可采用下述三種方式。 (1)定時(shí)傳送方式 對(duì)于一種A/D轉(zhuǎn)換其來(lái)說(shuō),轉(zhuǎn)換時(shí)間作為一項(xiàng)技術(shù)指標(biāo)是已知的和固定的。例如ADC0809轉(zhuǎn)換時(shí)間為128s,相當(dāng)于6MHz的MCS-51單片機(jī)共64個(gè)機(jī)器周期??蓳?jù)此設(shè)計(jì)一個(gè)延時(shí)子程序,A/D轉(zhuǎn)換啟動(dòng)后即調(diào)用此子程序,延遲時(shí)間一到,轉(zhuǎn)換肯定已經(jīng)完成了,接著就可進(jìn)行數(shù)據(jù)傳送。 (2)查詢方式 A/D轉(zhuǎn)換芯片由表明轉(zhuǎn)換完成的狀態(tài)信號(hào),例如ADC0809的EOC端。因此可以用查詢方式,測(cè)試EOC的狀態(tài),即可確認(rèn)轉(zhuǎn)換是否完成,并接著進(jìn)行數(shù)據(jù)傳送。 (3)中斷方式 把表明轉(zhuǎn)換完成的狀

11、態(tài)信號(hào)(EOC)作為中斷請(qǐng)求信號(hào),以中斷方式進(jìn)行數(shù)據(jù)傳送。 不管使用上述哪種方式,只要一旦確定轉(zhuǎn)換完成,即可通過(guò)指令進(jìn)行數(shù)據(jù)傳送。首先送出口地址并以信號(hào)有效時(shí),OE信號(hào)即有效,把轉(zhuǎn)換數(shù)據(jù)送上數(shù)據(jù)總線,供單片機(jī)接受。ADC0809工作時(shí),首先輸入3位地址,并使ALE為1,以將地址存入地址鎖存器中。此地址經(jīng)譯碼可選通8路模擬輸入之一到比較器。START上升沿將逐次逼近寄存器復(fù)位;下降沿則啟動(dòng)AD轉(zhuǎn)換,之后,EOC輸出信號(hào)變低,以指示轉(zhuǎn)換正在進(jìn)行,直到AD轉(zhuǎn)換完成,EOC變?yōu)楦唠娖剑甘続D轉(zhuǎn)換結(jié)束,并將結(jié)果數(shù)據(jù)存入鎖存器,這個(gè)信號(hào)也可用作中斷申請(qǐng)。當(dāng)OE輸入高電平時(shí),ADC的輸出三態(tài)門打開(kāi),轉(zhuǎn)換結(jié)

12、果的數(shù)字量可輸出到數(shù)據(jù)總線。AD轉(zhuǎn)換器的位數(shù)決定著信號(hào)采集的精度和分辨率。對(duì)于8通道的輸入信號(hào),其分辨率為05。8位AD轉(zhuǎn)換器的精度為:。2.2.2 ADC0809的工作時(shí)序圖6所示是ADC0809的工作時(shí)序圖。從該時(shí)序圖可以看出,地址鎖存信號(hào)ALE在上升沿將三位通道地址鎖存,相應(yīng)通道的模擬量經(jīng)過(guò)多路模擬開(kāi)關(guān)送到AD轉(zhuǎn)換器。啟動(dòng)信號(hào)START上升沿復(fù)位內(nèi)部電路,START的下降沿啟動(dòng)轉(zhuǎn)換,此時(shí)轉(zhuǎn)換結(jié)束信號(hào)EOC呈低電平狀態(tài),由于逐位逼近需要一定過(guò)程,所以,在此期間,模擬輸入量應(yīng)維持不變,比較器要一次次比較,直到轉(zhuǎn)換結(jié)束,此時(shí)變?yōu)楦唠娖?。若CPU發(fā)出輸出允許信號(hào)OE(輸出允許為高電平),則可讀出

13、數(shù)據(jù)。另外,ADC0809具有較高的轉(zhuǎn)換速度和精度,同時(shí)受溫度影響也較小。 圖6 ADC0809的工作時(shí)序圖2.2.3 ADC0809與AT89C52單片機(jī)的接口電路ADC0809與AT89C52單片機(jī)的接口電路如圖7所示。圖中,P2.0、P2.1、P2.2 輸出的低3位地址加到通道選擇端A、B、C,可作為通道編碼。其通道基本地址為0000H0007H。輸出數(shù)據(jù)與P0口連接,CLOCK、ALE一起與P2.4相連,START和P2.5連接,EOC與P2.3相連,OE和P2.6相連。圖7 ADC0809與AT89C52單片機(jī)接口電路2.3 LCD1602顯示電路字符型液晶顯示模塊是一種專門用于顯示

14、字母、數(shù)字、符號(hào)等點(diǎn)陣式LCD,目前常用16*1,16*2,20*2和40*2行等的模塊。LCD1602分為帶背光和不帶背光兩種,基控制器大部分為HD44780,帶背光的比不帶背光的厚,是否帶背光在應(yīng)用中并無(wú)差別。LCD1602采用標(biāo)準(zhǔn)的14腳(無(wú)背光)或16腳(帶背光)接口,各引腳接口說(shuō)明如下表1所示:表 1 LCD1602引腳接口說(shuō)明編號(hào)符號(hào)引腳說(shuō)明編號(hào)符號(hào)引腳說(shuō)明1VSS電源地9D2數(shù)據(jù)2VDD電源正極10D3數(shù)據(jù)3VL液晶顯示偏壓11D4數(shù)據(jù)4RS數(shù)據(jù)/命令選擇12D5數(shù)據(jù)5R/W讀/寫選擇13D6數(shù)據(jù)6E使能信號(hào)14D7數(shù)據(jù)7D0數(shù)據(jù)15BLA背光源正極8D1數(shù)據(jù)16BLK背光源負(fù)極

15、1602液晶模塊的讀寫操作、屏幕和光標(biāo)的操作都是通過(guò)指令編程來(lái)實(shí)現(xiàn)的。1602液晶模塊內(nèi)部的控制器共有11條控制指令,如下表2所示,其中1為高電平、0為低電平。表 2 LCD1602控制指令序號(hào)指令RSR/WD7D6D5D4D3D2D1D01清顯示00000000012光標(biāo)返回000000001*3置輸入模式00000001I/DS4顯示開(kāi)/關(guān)控制0000001DCB5光標(biāo)或字符移位000001S/CR/L*6置功能00001DLNF*7置字符發(fā)生存貯器地址0001字符發(fā)生存貯器地址8置數(shù)據(jù)存貯器地址001顯示數(shù)據(jù)存貯器地址9讀忙標(biāo)志或地址01BF計(jì)數(shù)器地址10寫數(shù)到CGRAM或DDRAM)1

16、0要寫的數(shù)據(jù)內(nèi)容指令1:清顯示,指令碼01H,光標(biāo)復(fù)位到地址00H位置。指令2:光標(biāo)復(fù)位,光標(biāo)返回到地址00H。指令3:光標(biāo)和顯示模式設(shè)置 I/D:光標(biāo)移動(dòng)方向,高電平右移,低電平左移 S:屏幕上所有文字是否左移或者右移。高電平表示有效,低電平則無(wú)效。指令4:顯示開(kāi)關(guān)控制。 D:控制整體顯示的開(kāi)與關(guān),高電平表示開(kāi)顯示,低電平表示關(guān)顯示 C:控制光標(biāo)的開(kāi)與關(guān),高電平表示有光標(biāo),低電平表示無(wú)光標(biāo) B:控制光標(biāo)是否閃爍,高電平閃爍,低電平不閃爍。指令5:光標(biāo)或顯示移位 S/C:高電平時(shí)移動(dòng)顯示的文字,低電平時(shí)移動(dòng)光標(biāo)。指令6:功能設(shè)置命令 DL:高電平時(shí)為4位總線,低電平時(shí)為8位總線 N:低電平時(shí)為

17、單行顯示,高電平時(shí)雙行顯示 F: 低電平時(shí)顯示5x7的點(diǎn)陣字符,高電平時(shí)顯示5x10的點(diǎn)陣字符。指令7:字符發(fā)生器RAM地址設(shè)置。指令8:DDRAM地址設(shè)置。指令9:讀忙信號(hào)和光標(biāo)地址 BF:為忙標(biāo)志位,高電平表示忙,此時(shí)模塊不能接收命令或者數(shù)據(jù),如果為低電平表示不忙。指令10:寫數(shù)據(jù)。其操作時(shí)序圖如下所示:圖8 讀操作時(shí)序圖圖9 寫操作時(shí)序圖本設(shè)計(jì)中采用液晶LCD1602顯示模數(shù)轉(zhuǎn)換器采集到的數(shù)據(jù),其D0D7與單片機(jī)的P0端口連接,使能端E、RS、RW分別與單片機(jī)P3.1、P3.0、P3.2連接,此電路原理簡(jiǎn)單,電路連接方便,如圖10所示。圖10 液晶LCD1602顯示電路2.4 鍵盤與單片

18、機(jī)連接電路本設(shè)計(jì)中使用了兩個(gè)獨(dú)立按鍵來(lái)選擇顯示對(duì)應(yīng)通道的電壓,其中KEY1每按一下通道數(shù)就減1并在LCD1602上顯示對(duì)應(yīng)通道的電壓,KEY2每按一下通道數(shù)就加1并在LCD1602上顯示對(duì)應(yīng)通道的電壓,這樣就十分方便查看不同通道的數(shù)據(jù)。鍵盤與單片機(jī)的連接電路如圖11所示。圖11 鍵盤與單片機(jī)的連接電路2.5系統(tǒng)整體電路圖 根據(jù)上述各個(gè)部分的電路,將每個(gè)部分的電路在仿真軟件PROTUES中連接起來(lái),仔細(xì)檢查線路后確保無(wú)誤后就可以得到系統(tǒng)的整體電路圖如12所示。圖12 系統(tǒng)整體電路圖3、軟件設(shè)計(jì)此次設(shè)計(jì)的多通道數(shù)據(jù)采集系統(tǒng)設(shè)置了8路模擬電壓輸入通道。仿真中為了便于調(diào)節(jié)輸入的模擬電壓,在輸入模擬信號(hào)

19、時(shí)采用電阻分壓,最終的采樣輸入電壓便可根據(jù)測(cè)試需要調(diào)節(jié),系統(tǒng)總流程圖如圖13所示:開(kāi)始系統(tǒng)初始化A/D數(shù)模轉(zhuǎn)換有鍵按下?Y選擇對(duì)應(yīng)的通道LCD1602顯示N圖13 系統(tǒng)流程圖4、系統(tǒng)仿真和測(cè)試結(jié)果根據(jù)方案設(shè)計(jì)結(jié)果,進(jìn)行了硬件電路在Proteus下的仿真。當(dāng)通過(guò)電位器調(diào)節(jié)AD轉(zhuǎn)換器輸入端的電壓時(shí),模擬電壓值經(jīng)過(guò)AD轉(zhuǎn)換后,經(jīng)由單片機(jī)將轉(zhuǎn)換后的電壓值發(fā)送至P0口,供LCD進(jìn)行顯示。仿真過(guò)程描述:通過(guò)KEIL軟件對(duì)所編程序進(jìn)行編譯,生成.hex文件,在PROTUES軟件中,用MCS51單片機(jī)調(diào)用.hex,即可進(jìn)行硬件的仿真。該仿真包括兩部分:1. 對(duì)8路電壓進(jìn)行采集,經(jīng)由AD轉(zhuǎn)換器進(jìn)行轉(zhuǎn)化,轉(zhuǎn)化后的

20、16進(jìn)制數(shù)存于單片機(jī)的內(nèi)部存儲(chǔ)器中。2. 對(duì)轉(zhuǎn)換后的電壓進(jìn)行顯示。將內(nèi)部存儲(chǔ)器中存儲(chǔ)的轉(zhuǎn)化后的電壓對(duì)應(yīng)的16進(jìn)制數(shù)付給P0口,由LCD進(jìn)行顯示。調(diào)節(jié)電位器LCD的顯示數(shù)據(jù)也會(huì)發(fā)生變化。仿真數(shù)據(jù)如下圖所示: 圖14 通路1數(shù)據(jù)采集結(jié)果 圖15 通路2數(shù)據(jù)采集結(jié)果 圖16 通路3數(shù)據(jù)采集結(jié)果 圖17 通路4數(shù)據(jù)采集結(jié)果 圖18 通路5數(shù)據(jù)采集結(jié)果 圖19 通路6數(shù)據(jù)采集結(jié)果 圖20 通路7數(shù)據(jù)采集結(jié)果 圖21 通路8數(shù)據(jù)采集結(jié)果5、性能分析根據(jù)上述仿真結(jié)果圖14至圖21可以得到:8路模擬通道電壓值分別設(shè)置為0.05V、0.85V、1.50V、2.30V、3.05V、3.70V、4.25V、5.00

21、V。經(jīng)過(guò)系統(tǒng)處理,LCD1602顯示的采集值分別為0.05V、0.84V、1.50V、2.29V、3.05V、3.70V、4.25V、5.00V。系統(tǒng)誤差為小于0.01。如果想看到某一路的數(shù)據(jù)采集值,可以通過(guò)按鍵KEY1、KEY2來(lái)調(diào)節(jié),這樣就方便查看。綜上所述:通過(guò)用PROTUES軟件的仿真發(fā)現(xiàn)此次設(shè)計(jì)的系統(tǒng)原理圖能夠?qū)崿F(xiàn)電壓的正確測(cè)量,而且電壓的誤差極小,LCD1602液晶屏能夠正確顯示出8路電壓測(cè)量結(jié)果。整個(gè)作品能較好的實(shí)現(xiàn)基本功能和擴(kuò)展功能。6、心得與體會(huì)7、參考文獻(xiàn)附錄一:源程序#include#include#define uchar unsigned char#define ui

22、nt unsigned int/*定義LCD1602接口信息*/sbit lcdrs=P30;/數(shù)據(jù)命令選擇位sbit lcden=P31;/使能位sbit lcdrw=P32;/*定義ADC0808接口信息*/sbit ADA=P20;sbit ADB=P21;sbit ADC=P22;sbit EOC=P23;sbit CLK=P24;sbit START=P25;sbit OE=P26;/*鍵盤管腳定義*/sbit key1=P33;sbit key2=P37;/*定義數(shù)據(jù)*/uchar tab1=48,46,48,48,48,46,48,48,48,46,48,48,48,46,48,

23、48;/存放AD采集數(shù)據(jù)uchar tab2=48,46,48,48,48,46,48,48,48,46,48,48,48,46,48,48;uchar tab3=TONGLU:;uchar tab4=DIANYA:;uchar tab5=12345678;uchar num,m=0,getdata=0;uint temp=0;/*延時(shí)函數(shù)*/void delay(uchar t)uchar x,y;for(x=t;x0;x-)for(y=110;y0;y-);void delayl(uchar ltime)uchar i;for(i=ltime;i0;i-)delay(255);/*寫命令函

24、數(shù)*/void write_com(uchar com)lcdrs=0;P0=com;delay(10);lcden=1;delay(10);lcden=0;/*寫數(shù)據(jù)函數(shù)*/void write_data(uchar date)lcdrs=1;P0=date;delay(10);lcden=1;delay(10);lcden=0;void disp(uchar h,l,uchar *p)write_com(0 x80+h*0 x40+l);while(*p!=0)write_data(*p); p+; /*初始化函數(shù)*/void LcdInit()lcdrw=0;delay(5);lcden

25、=0;/使能位置低電平 write_com(0 x38);write_com(0 x0c);write_com(0 x06);write_com(0 x01);write_com(0 x80);delayl(20);void TimeInit() TMOD=0 x10;/定時(shí)器1工作于方式1,16位不重裝初值 TH1=(65536-200)/256; /定時(shí)200us(5KHz) TL1=(65536-200)%256; EA=1; ET1=1; TR1=1;void AdTr(bit ADDA,ADDB,ADDC,uchar channel) START=0;OE=0;START=1;STA

26、RT=0;/A/D轉(zhuǎn)換啟動(dòng)信號(hào),正脈沖啟動(dòng)選中的模擬信號(hào)開(kāi)始轉(zhuǎn)換ADA=ADDA;ADB=ADDB;ADC=ADDC;delay(5);while(EOC=0);/啟動(dòng)轉(zhuǎn)換后EOC變?yōu)長(zhǎng),轉(zhuǎn)換結(jié)束后變?yōu)镠OE=1;getdata=P1;temp=getdata*1.0/255*500;OE=0;if(channel=4)channel=channel-4;tab24*channel=temp/100+0 x30; tab24*channel+2=(temp%100)/10+0 x30; tab24*channel+3=(temp%100)%10+0 x30;void keyscan()/* 按

27、鍵2進(jìn)行減1*/ uint k; if(key1=0) m-; if(m5) write_com(0 x80+0 x07); write_data(tab5m-1); write_com(0 x80+0 x47); for(k=0;k=5&m9) write_com(0 x80+0 x07); write_data(tab5m-1); write_com(0 x80+0 x47); for(k=0;k4;k+) write_data(tab24*(m-5)+k); if(m=1)m=1; while(key1=0); /等待按鍵釋放 if(key2=0) m+; if(m5) write_co

28、m(0 x80+0 x07); write_data(tab5m-1); write_com(0 x80+0 x47); for(k=0;k=5&m9) write_com(0 x80+0 x07); write_data(tab5m-1); write_com(0 x80+0 x47); for(k=0;k4;k+) write_data(tab24*(m-5)+k); if(m=9)m=0; while(key2=0); /等待按鍵釋放 void main() LcdInit();TimeInit();while(1) AdTr(0,0,0,0); delay(5); AdTr(0,0,1

29、,1); delay(5); AdTr(0,1,0,2); delay(5); AdTr(0,1,1,3); delay(5); AdTr(1,0,0,4); delay(5); AdTr(1,0,1,5); delay(5); AdTr(1,1,0,6); delay(5); AdTr(1,1,1,7); delay(5);disp(0,0,tab3);disp(1,0,tab4);keyscan(); void t1(void) interrupt 3 using 0 TH1=(65536-200)/256; TL1=(65536-200)%256; CLK=CLK;附錄二:本科生能力拓展

30、訓(xùn)練成績(jī)?cè)u(píng)定表姓 名性 別專業(yè)、班級(jí)題 目: 基于AD轉(zhuǎn)換模塊的單片機(jī)仿真和C語(yǔ)言開(kāi)發(fā)任務(wù)書答辯或質(zhì)疑記錄:成績(jī)?cè)u(píng)定依據(jù):最終評(píng)定成績(jī)(以優(yōu)、良、中、及格、不及格評(píng)定)指導(dǎo)教師簽字: 年 月 日g an employment tribunal claiEmployment tribunals sort out disagreements between employers and employees.You may need to make a claim to an employment tribunal if: you dont agree with the disciplinary ac

31、tion your employer has taken against you your employer dismisses you and you think that you have been dismissed unfairly.For more information about dismissal and unfair dismissal, seeDismissal.You can make a claim to an employment tribunal, even if you haventappealedagainst the disciplinary action y

32、our employer has taken against you. However, if you win your case, the tribunal may reduce any compensation awarded to you as a result of your failure to appeal.Remember that in most cases you must make an application to an employment tribunal within three months of the date when the event you are c

33、omplaining about happened. If your application is received after this time limit, the tribunal will not usually accept i.If you are worried about how the time limits apply to you, take advice from one of the organisations listed underFurther help.Employment tribunals are less formal than some other

34、courts, but it is still a legal process and you will need to give evidence under an oath or affirmation.Most people find making a claim to an employment tribunal challenging. If you are thinking about making a claim to an employment tribunal, you should get help straight away from one of the organis

35、ations listed underFurther help.If you are being represented by a solicitor at the tribunal, they may ask you to sign an agreement where you pay their fee out of your compensation if you win the case. This is known as adamages-based agreement. In England and Wales, your solicitor cant charge you mor

36、e than 35% of your compensation if you win the case.If you are thinking about signing up for a damages-based agreement, you should make sure youre clear about the terms of the agreement. It might be best to get advice from an experienced adviser, for example, at a Citizens Advice Bureau. To find you

37、r nearest CAB, including those that give advice by e-mail, click onnearest CAB.For more information about making a claim to an employment tribunal, seeEmployment tribunals.The (lack of) air up there Watch mCayman Islands-based Webb, the head of Fifas anti-racism taskforce, is in London for the Footb

38、all Associations 150th anniversary celebrations and will attend Citys Premier League match at Chelsea on Sunday.I am going to be at the match tomorrow and I have asked to meet Yaya Toure, he told BBC Sport.For me its about how he felt and I would like to speak to him first to find out what his exper

39、ience was.Uefa hasopened disciplinary proceedings against CSKAfor the racist behaviour of their fans duringCitys 2-1 win.Michel Platini, president of European footballs governing body, has also ordered an immediate investigation into the referees actions.CSKA said they were surprised and disappointe

40、d by Toures complaint. In a statement the Russian side added: We found no racist insults from fans of CSKA.Age has reached the end of the beginning of a word. May be guilty in his seems to passing a lot of different life became the appearance of the same day; May be back in the past, to oneself the

41、paranoid weird belief disillusionment, these days, my mind has been very messy, in my mind constantly. Always feel oneself should go to do something, or write something. Twenty years of life trajectory deeply shallow, suddenly feel something, do it.一字開(kāi)頭的年齡已經(jīng)到了尾聲?;蛟S是愧疚于自己似乎把轉(zhuǎn)瞬即逝的很多個(gè)不同的日子過(guò)成了同一天的樣子;或許是

42、追溯過(guò)去,對(duì)自己那些近乎偏執(zhí)的怪異信念的醒悟,這些天以來(lái),思緒一直很凌亂,在腦海中不斷糾纏??傆X(jué)得自己自己似乎應(yīng)該去做點(diǎn)什么,或者寫點(diǎn)什么。二十年的人生軌跡深深淺淺,突然就感覺(jué)到有些事情,非做不可了。The end of our life, and can meet many things really do?而窮盡我們的一生,又能遇到多少事情是真正地非做不可?During my childhood, think lucky money and new clothes are necessary for New Year, but as the advance of the age, will

43、 be more and more found that those things are optional; Junior high school, thought to have a crush on just means that the real growth, but over the past three years later, his writing of alumni in peace, suddenly found that isnt really grow up, it seems is not so important; Then in high school, thi

44、nk dont want to give vent to out your inner voice can be in the high school children of the feelings in a period, but was eventually infarction when graduation party in the throat, later again stood on the pitch he has sweat profusely, looked at his thrown a basketball hoops, suddenly found himself

45、has already cant remember his appearance.童年時(shí),覺(jué)得壓歲錢和新衣服是過(guò)年必備,但是隨著年齡的推進(jìn),會(huì)越來(lái)越發(fā)現(xiàn),那些東西根本就可有可無(wú);初中時(shí),以為要有一場(chǎng)暗戀才意味著真正的成長(zhǎng),但三年過(guò)去后,自己心平氣和的寫同學(xué)錄的時(shí)候,突然就發(fā)現(xiàn)是不是真正的成長(zhǎng)了,好像并沒(méi)有那么重要了;然后到了高中,覺(jué)得非要吐露出自己的心聲才能為高中生涯里的懵懂情愫劃上一個(gè)句點(diǎn),但畢業(yè)晚會(huì)的時(shí)候最終還是被梗塞在了咽喉,后來(lái)再次站在他曾經(jīng)揮汗如雨的球場(chǎng),看著他投過(guò)籃球的球框時(shí),突然間發(fā)現(xiàn)自己已經(jīng)想不起他的容顏。Originally, this world, can produce

46、a chemical reaction to an event, in addition to resolutely, have to do, and time.原來(lái),這個(gè)世界上,對(duì)某個(gè)事件能產(chǎn)生化學(xué)反應(yīng)的,除了非做不可的堅(jiān)決,還有,時(shí)間。A persons time, your ideas are always special to clear. Want, want, line is clear, as if nothing could shake his. Also once seemed to be determined to do something, but more often

47、is he backed out at last. Dislike his cowardice, finally found that there are a lot of love, there are a lot of miss, like shadow really have been doomed. Those who do, just green years oneself give oneself an arm injection, or is a self-righteous spiritual.一個(gè)人的時(shí)候,自己的想法總是特別地清晰。想要的,不想要的,界限明確,好像沒(méi)有什么可以

48、撼動(dòng)自己。也曾經(jīng)好像已經(jīng)下定了決心去做某件事,但更多的時(shí)候是最后又打起了退堂鼓。嫌惡過(guò)自己的怯懦,最終卻發(fā)現(xiàn)有很多緣分,有很多錯(cuò)過(guò),好像冥冥之中真的已經(jīng)注定。那些曾經(jīng)所謂的非做不可,只是青蔥年華里自己給自己注射的一支強(qiáng)心劑,或者說(shuō),是自以為是的精神寄托罷了。At the moment, the sky is dark, the air is fresh factor after just rained. Suddenly thought of blue plaid shirt; Those were broken into various shapes of stationery; From

49、the corner at the beginning of deep friendship; Have declared the end of the encounter that havent start planning. Those years, those days of do, finally, like youth, will end in our life.此刻,天空是陰暗的,空氣里有著剛下過(guò)雨之后的清新因子。突然想到那件藍(lán)格子襯衫;那些被折成各種各樣形狀的信紙;那段從街角深巷伊始的友誼;還有那場(chǎng)還沒(méi)有開(kāi)始就宣告了終結(jié)的邂逅計(jì)劃那些年那些天的非做不可,終于和青春一樣,都將在我們

50、的人生中謝幕。Baumgartner the disappointing news: Mission aborted. r plays an important role in this mission. Starting at the ground, conditions have to be very calm - winds less than 2 mph, with no precipitation or humidity and limited cloud cover. The balloon, with capsule attached, will move through the

51、 lower level of the atmosphere (the troposphere) where our day-to-day weather lives. It will climb higher than the tip of Mount Everest (5.5 miles/8.85 kilometers), drifting even higher than the cruising altitude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. As he cr

52、osses the boundary layer (called the tropopause),e can expect a lot of turbulence.The supersonic descent could happen as early as Sunda.The weatheThe balloon will slowly drift to the edge of space at 120,000 feet ( Then, I would assume, he will slowly step out onto something resembling an Olympic di

53、ving platform.Below, the Earth becomes the concrete bottom of a swimming pool that he wants to land on, but not too hard. Still, hell be traveling fast, so despite the distance, it will not be like diving into the deep end of a pool. It will be like he is diving into the shallow end. Skydiver preps

54、for the big jumpWhen he jumps, he is expected to reach the speed of sound - 690 mph (1,110 kph) - in less than 40 seconds. Like hitting the top of the water, he will begin to slow as he approaches the more dense air closer to Earth. But this will not be enough to stop him completely.If he goes too f

55、ast or spins out of control, he has a stabilization parachute that can be deployed to slow him down. His team hopes its not needed. Instead, he plans to deploy his 270-square-foot (25-square-meter) main chute at an altitude of around 5,000 feet (1,524 meters).In order to deploy this chute successful

56、ly, he will have to slow to 172 mph (277 kph). He will have a reserve parachute that will open automatically if he loses consciousness at mach speeds.Even if everything goes as planned, it wont. Baumgartner still will free fall at a speed that would cause you and me to pass out, and no parachute is guaranteed to work higher than 25,000 feet (7,620 meters).cause there25

展開(kāi)閱讀全文
溫馨提示:
1: 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
5. 裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

相關(guān)資源

更多
正為您匹配相似的精品文檔
關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號(hào):ICP2024067431號(hào)-1 川公網(wǎng)安備51140202000466號(hào)


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺(tái),本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請(qǐng)立即通知裝配圖網(wǎng),我們立即給予刪除!