基于單片機的溫度控制系統(tǒng)(完整資料)_第1頁
基于單片機的溫度控制系統(tǒng)(完整資料)_第2頁
基于單片機的溫度控制系統(tǒng)(完整資料)_第3頁
基于單片機的溫度控制系統(tǒng)(完整資料)_第4頁
基于單片機的溫度控制系統(tǒng)(完整資料)_第5頁
已閱讀5頁,還剩133頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

基于單片機的溫度控制系統(tǒng)(完整資料)(可以直接使用,可編輯優(yōu)秀版資料,歡迎下載)

基于單片機的溫度控制系統(tǒng)(完整資料)(可以直接使用,可編輯優(yōu)秀版資料,歡迎下載)畢業(yè)論文設(shè)計基于51單片機的溫度控制系統(tǒng)摘要在日常生活中溫度在我們身邊無時不在,溫度的控制和應用在各個領(lǐng)域都有重要的作用。很多行業(yè)中都有大量的用電加熱設(shè)備,和溫度控制設(shè)備,如用于報警的溫度自動報警系統(tǒng),熱處理的加熱爐,用于融化金屬的坩鍋電阻爐及各種不同用途的溫度箱等,這些都采用單片機技術(shù),利用單片機語言程序?qū)λ鼈冞M行控制。而單片機技術(shù)具有控制和操作使用方便、結(jié)構(gòu)簡單便于修改和維護、靈活性大且具有一定的智能性等特點,可以精確的控制技術(shù)標準,提高了溫控指標,也大大的提高了產(chǎn)品的質(zhì)量和性能。由于單片機技術(shù)的優(yōu)點突出,智能化溫度控制技術(shù)正被廣泛地采用。本文介紹了基于單片機AT89C51的溫度控制系統(tǒng)的設(shè)計方案與軟硬件實現(xiàn)。采用溫度傳感器DS18B20采集溫度數(shù)據(jù),7段數(shù)碼管顯示溫度數(shù)據(jù),按鍵設(shè)置溫度上下限,當溫度低于設(shè)定的下限時,點亮綠色發(fā)光二極管,當溫度高于設(shè)定的上限時,點亮紅色發(fā)光二極管。給出了系統(tǒng)總體框架、程序流程圖和Protel原理圖,并在硬件平臺上實現(xiàn)了所設(shè)計功能。關(guān)鍵詞:單片機溫度控制系統(tǒng)溫度傳感器AbstractIndailylife,thetemperatureinoursidetheever-present,thecontrolofthetemperatureandtheapplicationinvariousfieldsallhaveimportantrole。Manyindustrytherearealargenumberofelectricheatingequipment,andthetemperaturecontrolequipment,suchasusedforalarmautomatictemperaturealarmsystems,heattreatmentfurnace,usedtomeltmetalcrucibleresistancefurnace,andallkindsofdifferentUSESoftemperatureboxandsoon,theseusingsinglechipmicrocomputer,usingsinglechipcomputerlanguageprogramtocontrolthem.Andsingle-chipmicrocomputertechnologyhascontrolandconvenientinoperation,easytomodifyandmaintenanceofsimplestructure,flexibilityislargeandhassomeoftheintelligenceandothercharacteristics,wecanaccuratelycontroltechnologystandardtoimprovethetemperaturecontrolindex,alsogreatlyimprovethequalityoftheproductsandperformance.Becauseoftheadvantagesofthesinglechipmicrocomputerintelligenttemperaturecontroltechnologyoutstanding,isbeingwidelyadopted。ThispaperintroducesthetemperaturecontrolbasedonsinglechipmicrocomputerAT89C51designschemeofthesystemandthehardwareandsoftwareimplementation。ThetemperaturesensorDS18B20collectiontemperaturedata,7periodofdigitalpipedisplay,theupperandlowerlimitsoftemperaturebuttonwhentemperaturebelowthesettingofthelowerlimit,lightgreenleds,whenthetemperatureishigherthanthesetonthelimit,lightredleds.Giventhesystemframeworkandprogramflowchartandprinciplechart,andinProtelhardwareplatformtorealizethefunctionofthedesign.Keywords:SCMTemperaturecontrolsystemTemperaturesensors目錄TOC\o”1—3"\h\z\uHYPERLINK\l”_Toc295836733"摘要I第一章前言1HYPERLINK\l”_Toc295836736”1。1溫度控制系統(tǒng)設(shè)計發(fā)展歷史及意義1HYPERLINK\l”_Toc295836737”1.2溫度控制系統(tǒng)的目的11。3溫度控制系統(tǒng)完成的功能1第二章總體設(shè)計方案2HYPERLINK\l”_Toc295836740”2。1方案一2_Toc295836742"3.1DS18B20簡介5HYPERLINK\l”_Toc295836743"3。1。1DS18B20封裝與引腳5HYPERLINK\l”_Toc295836744”3.1.2DS18B20的簡單性能53.3DS18B20的測溫原理6HYPERLINK\l”_Toc295836747”3。3.1測溫原理:63.3.2DS18B20的溫度采集過程9HYPERLINK\l”_Toc295836749”第四章單片機接口設(shè)計10HYPERLINK\l”_Toc295836750"4。1設(shè)計原則104。2單片機引腳連接10HYPERLINK\l”_Toc295836752"4。2。1單片機引腳圖10HYPERLINK\l”_Toc295836753"4.2。2串口引腳11第五章硬件電路設(shè)計12_Toc295836758"5。2.2程序組成16HYPERLINK\l”_Toc295836759”結(jié)束語20HYPERLINK\l”_Toc295836760"致謝21,外接電源供電DS18B20發(fā)送“1”計數(shù)器計數(shù)器斜率累加器減到0減法計數(shù)器預置低溫度系數(shù)振蕩器高溫度系數(shù)振蕩器計數(shù)比較器預置溫度寄存器減到0圖3。2測溫原理內(nèi)部裝置3。3。2DS18B20的溫度采集過程由于DS18B20單線通信功能是分時完成的,他有嚴格的時隙概念,因此讀寫時序很重要,系統(tǒng)對DS18B20的各種操作必須按協(xié)議進行。操作協(xié)議為:初始化DS18B20(發(fā)復位脈沖)→發(fā)ROM功能命令→發(fā)存儲器操作命令→處理數(shù)據(jù).溫度的采集流程如圖3。3所示.初始化初始化DS18B20跳過ROM匹配溫度變換延時1S跳過ROM匹配讀暫存器轉(zhuǎn)換成顯示碼數(shù)碼管顯示圖3.3DS18B20測溫流程第四章單片機接口設(shè)計4。1設(shè)計原則DS18B20有2種供電方式,一種是直流電源,還有一種是寄生蟲方式供電。采用電源供電方式,此時DS18B20的1腳接地,2腳作為信號線,3腳接電源。電源是利用直流穩(wěn)壓電源。當DS18B20處于寫存儲器操作和溫度A/D變換操作時,總線上必須有強的上拉,上拉開啟時間最大為10μs。采用寄生電源供電方式是VDD和GND端均接地。由于單線制只有一根線,因此發(fā)送接收口必須是三狀態(tài)的。主機控制DS18B20完成溫度轉(zhuǎn)換必須經(jīng)過3個步驟:初始化;ROM操作指令;存儲器操作指令。4.2單片機引腳連接4。2。1單片機引腳圖單片機引腳如圖4。1所示。圖4.1單片機引腳4。2.2串口引腳串口引腳的連接圖如附錄1.第五章硬件電路設(shè)計5。1主要硬件電路設(shè)計硬件電路主要包括:顯示電路,DS18B20溫度傳感器檢測電路,按鍵電路,晶振電路,二極管顯示報警電路,電源電路。(1)顯示電路顯示電路采用了7段共陰數(shù)碼管掃描電路,通過單片機的P0.0到P0.7八個端口接數(shù)碼管的八個引腳,數(shù)碼管的9號引腳接地.用來顯示當前檢測的溫度值,精確度為0。1。如圖5.1所示。節(jié)約了單片機的輸出端口,便于程序的編寫。本設(shè)計中還有一組數(shù)碼管由P2.0到P2。7連接,除接口不同外其他一樣,如圖5.2。圖5.1顯示測量結(jié)果電路圖圖5.2顯示限定溫度電路(2)DS18B20溫度傳感器檢測電路溫度采集通過數(shù)字化的溫度傳感器DS18B20,通過QD接向單片機的P3。0口.DS18B20溫度傳感器電路如圖5。3所示。圖5。3溫度傳感器電路引腳圖(3)按鍵電路按鍵電路如圖5.4所示.由K2、K3、K4三個按鍵控制上、下限溫度值。P3.1接口接K4按鍵.P3.2接口接入K3按鍵.P3.3接口接K2按鍵。1。K2溫度上下限減少鍵:減少溫度上下限的值。

2。K3溫度上下限增加鍵:增加溫度上下限的值.

3.K4溫控開關(guān)鍵:進入溫控的切換鍵.圖5.4按鍵電路圖(4)晶振控制電路晶振采用的是12MHZ的標準晶振。接入單片機的XTAL1、XTAL2.晶振控制電路如圖5.5所示。圖5.5晶振控制電路圖(5)復位電路復位電路采用了人工復位的方式,按下按鍵K1使單片機復位。直接接到單片機的RESET引腳。復位電路如圖5.6所示圖5。6復位電路圖(6)二極管顯示報警電路二極管顯示報警電路如圖5.7所示.通過單片機的P3。4和P3.5兩個端口送出,采用的是高電平驅(qū)動,使其發(fā)光發(fā)出警告。圖5.7二極管顯示電路(8)電源部分電源部分才用的是直流穩(wěn)壓電源,產(chǎn)生5V的穩(wěn)定直流電壓。電源設(shè)計部分如圖5.8所示。圖5。8電源部分電路5.2軟件系統(tǒng)設(shè)計5。2.1軟件系統(tǒng)設(shè)計一個應用系統(tǒng)要完成各項功能,首先必須有較完善的硬件作保證。同時還必須得到相應設(shè)計合理的軟件的支持,尤其是微機應用高速發(fā)展的今天,許多由硬件完成的工作,都可通過軟件編程而代替.甚至有些必須采用很復雜的硬件電路才能完成的工作,用軟件編程有時會變得很簡單,如數(shù)字濾波,信號處理等.因此充分利用其內(nèi)部豐富的硬件資源和軟件資源,采用與C51系列單片機相對應的51匯編語言和結(jié)構(gòu)化程序設(shè)計方法進行軟件編程.程序設(shè)計語言有三種:機器語言、匯編語言和高級語言。機器語言是機器唯一能“懂”的語言,用匯編語言或高級語言編寫的程序(稱為源程序)最終都必須翻譯成機器語言的程序(成為目標程序),計算機才能“看懂",然后逐一執(zhí)行。高級語言是面向問題和計算過程的語言,它可通過于各種不同的計算機,用戶編程時不必仔細了解所用的計算機的具體性能與指令系統(tǒng),而且語句的功能強,常常一個語句已相當于很多條計算機指令,于是用高級語言編制程序的速度比較快,也便于學習和交流,但是本系統(tǒng)卻選用了匯編語言。原因在于,本系統(tǒng)是編制程序工作量不大、規(guī)模較小的單片機微控制系統(tǒng),使用匯編語言可以不用像高級語言那樣占用較多的存儲空間,適合于存儲容量較小的系統(tǒng).同時,本系統(tǒng)對位處理要求很高,需要解決大量的邏輯控制問題。51指令系統(tǒng)的指令長度較短,它在存儲空間和執(zhí)行時間方面具有較高的效率,編成的程序占用內(nèi)存單元少,執(zhí)行也非常的快捷,與本系統(tǒng)的應用要求很適合。而且AT89C-51指令系統(tǒng)有豐富的位操作(或稱位處理)指令,可以形成一個相當完整的位操作指令子集,這是AT89C-51指令系統(tǒng)主要的優(yōu)點之一。對于要求反應靈敏與控制及時的工控、檢測等實時控制系統(tǒng)以及要求體積小、系統(tǒng)小的許多“電腦化”產(chǎn)品,可以充分體現(xiàn)出匯編語言簡明、整齊、執(zhí)行時間短和易于使用的特點.本裝置的軟件包括主程序、讀出溫度子程序、復位應答子程序、寫入子程序、以及有關(guān)DS18B20的程序(初始化子程序、寫程序和讀程序)。5.2.2程序組成系統(tǒng)程序主要包括主程序,讀出溫度子程序,寫入子程序,門限調(diào)節(jié)子程序等。1)主程序主程序的主要功能是負責溫度的實時顯示、讀出并處理DS18B20的測量的當前溫度值,溫度測量每1s進行一次。這樣可以在一秒之內(nèi)測量一次被測溫度,其程序流程見圖5.9所示.通過調(diào)用讀溫度子程序把存入內(nèi)存儲中的整數(shù)部分與小數(shù)部分分開存放在不同的兩個單元中,然后通過調(diào)用顯示子程序顯示出來。圖5.9主程序流程圖2)讀出溫度子程序讀出溫度子程序的主要功能是讀出RAM中的9字節(jié),在讀出時需進行CRC校驗,校驗有錯時不進行溫度數(shù)據(jù)的改寫,程序流程圖如圖5。10所示。DS18B20的各個命令對時序的要求特別嚴格,所以必須按照所要求的時序才能達到預期的目的,同時,要注意讀進來的是高位在后低位在前,共有12位數(shù),小數(shù)4位,整數(shù)7位,還有一位符號位。DS18B20復位、應答子程序DS18B20復位、應答子程序跳過ROM匹配命令跳過ROM匹配命令寫入子程序?qū)懭胱映绦驕囟绒D(zhuǎn)換命令溫度轉(zhuǎn)換命令寫入子程序?qū)懭胱映绦蝻@示子程序(延時)顯示子程序(延時)DS18B20復位、應答子程序DS18B20復位、應答子程序跳過ROM匹配命令跳過ROM匹配命令寫入子程序?qū)懭胱映绦蜃x溫度命令子程序讀溫度命令子程序終終止圖5。10讀出溫度子程序3)寫入子程序?qū)懭胱映绦虻牧鞒虉D如5.11所示。開始開始進位C清0進位C清0終止R2是否為0P3.0置0延時46US帶進位右移延時12USP3.0清0終止R2是否為0P3.0置0延時46US帶進位右移延時12USP3.0清0圖5.11寫入子程序4)門限調(diào)節(jié)子程序門限調(diào)節(jié)子程序流程如圖5。12所示。圖5。12門限調(diào)節(jié)電路結(jié)束語本文詳細講述了系統(tǒng)設(shè)計方案,并給出了相關(guān)程序流程。本設(shè)計應用性比較強,可以應用在倉庫溫度、大棚溫度、機房溫度、水池等的監(jiān)控。另外,如果把本設(shè)計方案擴展為多點溫度控制,加上上位機,則可以實現(xiàn)遠程溫度監(jiān)控系統(tǒng),將具有更大的應用價值。本文的創(chuàng)新點在于詳細設(shè)計了基于單片機AT89C51的溫度監(jiān)控系統(tǒng),設(shè)計程序已經(jīng)。此系統(tǒng)可廣泛用于溫度在DS18B20測溫范圍之內(nèi)的場合,有良好的應用前景。由于單片機的各種優(yōu)越的特性,使得它的經(jīng)濟效益顯的更加突出,有很好的實用性。附錄附錄1原理電路總設(shè)計圖附錄2源程序: FK1EQU24H;F(k)實測溫度FKEQU25H;F(k)實測溫度暫存RKEQU26H;R(k)給定溫度SHI1EQU30H;實測溫度十位SHI2EQU31H;實測溫度個位SHI3EQU32H;實測溫度小數(shù)位GAOEQU33H;給定溫度十位ZHOEQU34H;給定溫度個位DIEQU35H;給定溫度小數(shù)位CNTEQU37H;按鍵消抖計數(shù)器LSBEQU50H;檢測溫度低8位MSBEQU51H;檢測溫度高8位K_INMBITP3.1;DI位設(shè)定溫度按鍵K_INHBITP3。2;ZHO位設(shè)定溫度按鍵KIBITP3.3;GAO位設(shè)定溫度按鍵DQBITP3.0;DS18B20的溫度輸入口ORG0000H;主程序入口地址AJMPMAIN;跳轉(zhuǎn)到主程序ORG000BH;T0中斷入口地址ORG001BH;T1中斷入口地址ORG0050HMAIN:MOVSP,#60H;堆棧指針初始化MOVGAO,#0;置設(shè)定值顯示十位初值MOVZHO,#0;置設(shè)定值顯示個位初值MOVDI,#0;置設(shè)定值顯示小數(shù)位初值MOVCNT,#10;MOVTMOD,#11H;定時器T0、T1初始化(方式1)MOVTH0,#3CH;T0定時器定時常數(shù)MOVTL0,#0B0H;MOVTH1,#0FCH;T1定時器定時常數(shù)MOVTL1,#18H;SETBPT1;T1優(yōu)先中斷MOVIE,#8AH;中斷使能SETBTR0;啟動定時器T0SETBTR1;啟動定時器T1LOOP:ACALLGETTMP;調(diào)用測溫子程序ACALLBBLD;調(diào)用二十進制子程序ACALLTER;調(diào)用拆字子程序ACALLXIAOSHU;調(diào)用小數(shù)處理子程序ACALLDISP1;調(diào)用測得溫度顯示程序ACALLKEY;調(diào)用按鍵處理子程序ACALLIDTB;調(diào)用十二進制轉(zhuǎn)換子程序ACALLCHK1;調(diào)用報警子程序ACALLDISP2;調(diào)用設(shè)定溫度顯示子程序AJMPLOOP;循環(huán);*******測溫子程序******GETTMP:ACALLRESET_PULSEACALLPRESENCEMOVA,#0CCHACALLWRITE_BYTE;發(fā)跳過ROM命令MOVA,#44HACALLWRITE_BYTE;發(fā)出溫度轉(zhuǎn)換命令JNBDQ,$ACALLRESET_PULSEACALLPRESENCEMOVA,#0CCH;發(fā)跳過ROM命令ACALLWRITE_BYTEMOVA,#0BEH;發(fā)讀存儲器命令ACALLWRITE_BYTEACALLREAD_BYTEMOVLSB,A;溫度值低位字節(jié)送LSBACALLREAD_BYTEMOVMSB,A;溫度值高位字節(jié)送MSBACALLRESET_PULSEACALLPRESENCEMOVA,MSBSWAPAANLA,#70HMOVFK,AMOVA,LSBSWAPAANLA,#0FHORLFK,AMOVFK1,F(xiàn)KRET;*****讀DS18B20的程序*******READ_BYTE:MOVR6,#8READ1:CLRDQNOPNOPSETBDQNOPNOPNOPMOVR5,AMOVC,DQMOVA,R5MOVR7,#30DJNZR7,$RRCADJNZR6,READ1RETPRESENCE:JBDQ,$JNBDQ,$RETRESET_PULSE:CLRDQMOVR7,#250DJNZR7,$SETBDQMOVR7,#10DJNZR7,$RET;**********寫DS18B20的程序*******WRITE_BYTE:MOVR6,#8WRITE:RRCAJCWRITE1CLRDQMOVR7,#30DJNZR7,$SETBDQNOPNOPNOPNOPDJNZR6,WRITERETWRITE1:CLRDQNOPNOPNOPNOPSETBDQMOVR7,#30DJNZR7,$DJNZR6,WRITERET;******二十進制轉(zhuǎn)換子程序*****BBLD:CLRAMOVR2,AMOVR7,#8BBCD1:CLRCMOVA,FKRLCAMOVFK,AMOVA,R2ADDCA,R2DAAMOVR2,ADJNZR7,BBCD1RET;******拆字子程序*******TER:MOVA,R2ANLA,#0FHMOVSHI2,AMOVA,R2SWAPAANLA,#0FHMOVSHI1,ARET;*******小數(shù)部分處理子程序******XIAOSHU:CLRCMOVR3,#3MOVA,50HLOOP2:RRCADJNZR3,LOOP2ANLA,#01HCJNEA,#01H,XIAOSHU2MOVSHI3,#5RETXIAOSHU2:MOVSHI3,#0RET;******按鍵部分處理子程序*******KEY:MOVCNT,#80JBK_INM,KEY1ACALLDISP1ACALLDISP2ACALLDISP1ACALLDISP2JBK_INM,KEY1WAIT0:JBK_INM,KEY2ACALLDISP1ACALLDISP2DJNZCNT,WAIT0KEY2:MOVA,DIADDA,#5DAAMOVDI,ASUBBA,#09HJCKEY1MOVDI,#0KEY1:MOVCNT,#80JBK_INH,KEY4ACALLDISP1ACALLDISP2ACALLDISP1ACALLDISP2JBK_INH,KEY4WAIT1:JBK_INH,KEY3ACALLDISP1ACALLDISP2DJNZCNT,WAIT1KEY3:MOVA,ZHOADDA,#1DAAMOVZHO,ACJNEA,#10H,KEY4MOVZHO,#0KEY4:MOVCNT,#80JBKI,KEY_BACKACALLDISP1ACALLDISP2ACALLDISP1ACALLDISP2JBKI,KEY_BACKWAIT2:JBKI,KEY5ACALLDISP1ACALLDISP2DJNZCNT,WAIT2KEY5:MOVA,GAOADDA,#1DAAMOVGAO,ACJNEA,#10H,KEY_BACKMOVGAO,#0KEY_BACK:RET;******延時程序1******D0.6S:MOVR3,#64HDEL3:MOVR4,#384HDEL4:NOPNOPNOPDJNZR4,DEL4DJNZR3,DEL3RET;******實測溫度顯示部分子程序*******DISP1:MOVDPTR,#TABMOVA,SHI1MOVCA,@A+DPTRMOVP0,AMOVP1,#3FHCLRP1。0ACALLTMMOVA,SHI2MOVCA,@A+DPTRMOVP0,AMOVP1,#3FHSETBP0。7CLRP1。1ACALLTMMOVA,SHI3MOVCA,@A+DPTRMOVP0,AMOVP1,#3FHCLRP1。2ACALLTM;******實測溫度顯示部分子程序*******DISP2:MOVDPTR,#TABMOVA,GAOMOVCA,@A+DPTRMOVP2,AMOVP1,#3FHCLRP1.3ACALLTMMOVA,ZHOMOVCA,@A+DPTRMOVP2,AMOVP1,#3FHSETBP2.7CLRP1。4ACALLTMMOVA,DIMOVCA,@A+DPTRMOVP2,AMOVP1,#3FHCLRP1。5ACALLTMRETTAB:DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH;****顯示延時子程序*******TM:MOVR1,#30TM1:MOVR2,#25TM2:DJNZR2,TM2DJNZR1,TM1RET;*******十二進制轉(zhuǎn)換子程序*******IDTB:MOVR0,#33HMOVR2,#1MOVA,@R0MOV52H,ADITB1:MOVA,52HMOVB,#10MULABMOV52H,AMOVA,BINCR0MOVA,52HADDA,@R0MOV52H,AMOVRK,52HRET;*******設(shè)定溫度越線報警子程序*****CHK1:MOVA,DICLRCSUBBA,#0MOVA,ZHOSUBBA,#0MOVA,GAOSUBBA,#4JCOUTBMOVA,DICLRCSUBBA,#5MOVA,ZHOSUBBA,#0MOVA,GAOSUBBA,#9JNCOUTAMOVA,#00HRETOUTA:MOVGAO,#9MOVZHO,#0MOVDI,#0CLRP3.4ACALLD0。6SSETBP3。4RETOUTB:MOVGAO,#4MOVZHO,#0MOVDI,#0CLRP3。4ACALLD0.6SSETBP3。4RETEND參考文獻1.張友德主編《單片微型機原理,應用與實驗》復旦大學出版社出版19932.何立民主編《單片機應用技術(shù)選編(1)》北京航空航天大學出版社20003.韋瓏珅;楊榮松;基于DS18B20的單片機多點溫度測量系統(tǒng)機械與電子4.趙娜;趙剛;于珍珠;郭守清;基于51單片機的溫度測量系統(tǒng),2007,(02)5.StevenF。Barrett,DanielJ。Pack。EmbeddedSystem[M].北京:電子工業(yè)出版社,20066.陳躍東.DS18B20集成溫度傳感器原理與應用[J]。安徽機電學院學報,20027.閻石.數(shù)字電子技術(shù)基礎(chǔ)(第三版)[M].北京:高等教育出版社,19898.李朝青,單片機原理及接口技術(shù)(簡明修訂版)[M]。北京:北京航空航天大學出版社,19989.李廣弟。單片機基礎(chǔ)[M]。北京:北京航空航天大學出版社,199410.金偉正。單線數(shù)字溫度傳感器的原理與應用[J]。電子技術(shù)與應用,200011.李鋼.1—Wire總線數(shù)字溫度傳感器DS18B20原理及應用.現(xiàn)代電子技術(shù)[J]南昌工程學院畢業(yè)設(shè)計(論文)成績評定和評語姓名班級學號Ⅰ.畢業(yè)設(shè)計(論文)題目:Ⅱ。指導教師評語及評分評語:評分:指導教師:年月日Ⅲ。答辯委員會(小組)評語及評分評語:評分:總評成績:答辯委員會(小組)負責人:年月

外文原文:

Design

of

the

Temperature

Control

System

Based

on

AT89C51

ABSTRACT

The

principle

and

functions

of

the

temperature

control

system

based

on

micro

controller

AT89C51

are

studied,

and

the

temperature

measurement

unit

consists

of

the

1—Wire

bus

digital

temperature

sensor

DS18B20。

The

system

can

be

expected

to

detect

the

preset

temperat(yī)ure,

display

time

and

save

monitoring

data。

An

alarm

will

be

given

by

system

if

the

temperature

exceeds

the

upper

and

lower

limit

value

of

the

temperature

which

can

be

set

discretionarily

and

then

automatic

control

is

achieved,

thus

the

temperature

is

achieved

monitoring

intelligently

within

a

certain

range.

Basing

on

principle

of

the

system,

it

is

easy

to

make

a

variety

of

other

non—linear

control

systems

so

long

as

the

software

design

is

reasonably

changed.

The

system

has

been

proved

to

be

accurate,

reliable

and

satisfied

through

field

practice.

KEYWORDS:

AT89C51;

micro

controller;

DS18B20;

temperature

1

INTRODUCTION

Temperature

is

a

very

important

parameter

in

human

life.

In

the

modern

society,

temperature

control

(TC)

is

not

only

used

in

industrial

production,

but

also

widely

used

in

other

fields.

With

the

improvement

of

the

life

quality,

we

can

find

the

TC

appliance

in

hotels,

factories

and

home

as

well.

And

the

trend

that

TC

will

better

serve

the

whole

society,

so

it

is

of

great

significance

to

measure

and

control

the

temperature.

Based

on

the

AT89C51

and

temperature

sensor

DS18B20,

this

system

controls

the

condition

temperature

intelligently。

The

temperature

can

be

set

discretionarily

within

a

certain

range。

The

system

can

show

the

time

on

LCD,

and

save

monitoring

data;

and

automatically

control

the

temperature

when

the

condition

temperat(yī)ure

exceeds

the

upper

and

lower

limit

value.

By

doing

so

it

is

to

keep

the

temperat(yī)ure

unchanged.

The

system

is

of

high

anti-jamming,

high

control

precision

and

flexible

design;

it

also

fits

the

rugged

environment。

It

is

mainly

used

in

people's

life

to

improve

the

quality

of

the

work

and

life。

It

is

also

versatile,

so

that

it

can

be

convenient

to

extend

the

use

of

the

system。

So

the

design

is

of

profound

importance.

The

general

design,

hardware

design

and

software

design

of

the

system

are

covered。

1.1

Introduction

The

8—bit

AT89C51

CHMOS

microcontrollers

are

designed

to

handle

high-speed

calculations

and

fast

input/output

operations.

MCS

51

microcontrollers

are

typically

used

for

high-speed

event

control

systems。

Commercial

applications

include

modems,

motor—control

systems,

printers,

photocopiers,

air

conditioner

control

systems,

disk

drives,

and

medical

instruments.

The

automotive

industry

use

MCS

51

microcontrollers

in

engine-control

systems,

airbags,

suspension

systems,

and

antilock

braking

systems

(ABS)。

The

AT89C51

is

especially

well

suited

to

applications

that

benefit

from

its

processing

speed

and

enhanced

on—chip

peripheral

functions

set,

such

as

automotive

power-train

control,

vehicle

dynamic

suspension,

antilock

braking,

and

stability

control

applicat(yī)ions。

Because

of

these

critical

applications,

the

market

requires

a

reliable

cost-effective

controller

with

a

low

interrupt

latency

response,

ability

to

service

the

high

number

of

time

and

event

driven

integrat(yī)ed

peripherals

needed

in

real

time

applications,

and

CPU

with

above

average

processing

power

in

a

single

package。

The

financial

and

legal

risk

of

having

devices

that

operate

unpredictably

is

very

high.

Once

in

the

market,

particularly

in

mission

critical

applications

such

as

an

autopilot

or

anti-lock

braking

system,

mistakes

are

financially

prohibitive。

Redesign

costs

can

run

as

high

as

a

$500K,

much

more

if

the

fix

means

2

back

annotating

it

across

a

product

family

that

share

the

same

core

and/or

peripheral

design

flaw。

In

addition,

field

replacements

of

components

is

extremely

expensive,

as

the

devices

are

typically

sealed

in

modules

with

total

value

several

times

that

of

the

component。

To

mitigate

these

problems,

it

is

essential

that(yī)

comprehensive

testing

of

the

controllers

be

carried

out

at

both

the

component

level

and

system

level

under

worst

case

environmental

and

voltage

conditions.

This

complete

and

thorough

validation

necessitat(yī)es

not

only

well—defined

process

but

also

a

proper

environment

and

tools

to

facilitate

and

execute

the

mission

successfully.

Intel

Chandler

Platform

Engineering

group

provides

post

silicon

system

validation

(SV)

of

various

micro-controllers

and

processors.

The

system

validat(yī)ion

process

can

be

broken

into

three

major

parts.

The

type

of

the

device

and

its

applicat(yī)ion

requirements

determine

which

types

of

testing

are

performed

on

the

device.

1.2

The

AT89C51

provides

the

following

standard

features

4Kbytes

of

Flash,

128

bytes

of

RAM,

32

I/O

lines,

two

16—bittimer/counters,

a

five

vector

two-level

interrupt

architecture,

a

full

duple

ser—ial

port,

on-chip

oscillat(yī)or

and

clock

circuitry。

In

addition,

the

AT89C51

is

designed

with

stat(yī)ic

logic

for

operation

down

to

zero

frequency

and

supports

two

software

selectable

power

saving

modes。

The

Idle

Mode

stops

the

CPU

while

allowing

the

RAM,

timer/counters,

serial

port

and

interrupt

sys

—tem

to

continue

functioning。

The

Power—down

Mode

savesthe

RAM

contents

but

freezes

the

oscil–lator

disabling

all

other

chip

functions

until

the

next

hardware

reset.

1.3Pin

Description

VCC

Supply

voltage。

GND

Ground。

Port

0:Port

0

is

an

8-bit

open—drain

bi-directional

I/O

port。

As

an

output

port,

each

pin

can

sink

eight

TTL

inputs.

When

1s

are

written

to

port

0

pins,

the

pins

can

be

used

as

high

impedance

inputs.

Port

0

may

also

be

configured

to

be

the

multiplexed

low

order

address/data

bus

during

accesses

to

external

program

and

data

memory.

In

this

mode

P0

has

internal

pull

ups。

Port

0

also

receives

the

code

bytes

during

Flash

programming,

and

outputs

the

code

bytes

during

program

verification.

External

pull

ups

are

required

during

program

verification.

Port

1:Port

1

is

an

8-bit

bi—directional

I/O

port

with

internal

pull

ups。

The

Port

1

output

buffers

can

sink/so

-urce

four

TTL

inputs。

When

1s

are

written

to

Port

1

pins

they

are

pulled

high

by

the

internal

pull

ups

and

can

be

used

as

inputs。

As

inputs,

Port

pins

that

are

externally

being

pulled

low

will

source

current

(IIL)

because

of

the

internal

pullups.

Port

1

also

receives

the

low—order

address

bytes

during

Flash

programming

and

verification。

Port

2:Port

2

is

an

8—bit

bi-directional

I/O

port

with

internal

pull

ups。

The

Port

2

output

buffers

can

sink/source

four

TTL

inputs.

When

1s

are

written

to

Port

2

pins

they

are

pulled

high

by

the

internal

pull

ups

and

can

be

used

as

inputs.

As

inputs,

Port

pins

that

are

externally

being

pulled

low

will

source

current

(IIL)

because

of

the

internal

pull

ups.

Port

emits

the

high-order

address

byte

during

fetches

from

external

program

memory

and

during

accesses

to

Port

2

pins

that

are

externally

being

pulled

low

will

source

current

(IIL)

because

of

the

internal

pull

ups。

Port

2

emits

the

high—order

address

byte

during

fetches

from

external

program

memory

and

during

accesses

to

external

data

memory

that

use

16-bit

addresses

(MOVX@DPTR)。

In

this

application,

it

uses

strong

internal

pull—ups

when

emitting

1s.

During

accesses

to

external

dat(yī)a

memory

that

use

8—bit

addresses

(MOVX

RI),

Port

2

emits

the

contents

of

the

P2

S

溫馨提示

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

評論

0/150

提交評論