【正文】
s physical property and the physical characteristics will also have the varying degree change, if the ambient humidity control will not be good, also will have the enormous influence to the test result and the product quality.AT89C51:The AT89C51 is a lowpower, highperformance CMOS 8bit microputer with 4Kbytes of Flash Programmable and Erasable Read Only Memory (PEROM). Thedevice is manufactured using Atmel’s high density nonvolatile memory technologyand is patible with the industry standard MCS51? instruction set and pinout. The onchip Flash allows the program memory to be reprogrammed insystem or by a conventional nonvolatile memory programmer. By bining a versatile 8bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microputer which provides a highly flexible and cost effective solution to many embedded control applications. The AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16bit timer/counters, a five vector twolevel interrupt 本科生畢業(yè)設(shè)計(jì)(論文)30architecture,a full duplex serial port, onchip oscillator and clock , AT89C51 may defer to the conventional method to carry on the programming, also may the online programming. It will use in mon the microprocessor and the Flash memory will unify in together, specially might repeatedly scratch the Flash memory which will write to be possible effectively to reduce the development cost.Pin Description:Port 0:Port 0 is an 8bit open drain bidirectional 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 highimpedance 0 may also be configured to be the multiplexed loworder,address/data bus during accesses to external program,and data memory. In this mode P0 has internal pullups.Port 0 also receives the code bytes during Flash programing,and outputs the code bytes during program pullups are required during program verification.Port 1:Port 1 is an 8bit bidirectional I/O port with internal Port 1 output buffers can sink/source four TTL 1s are written to Port 1 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 1 pins that are externally being pulled low will source current (IIL) because of the internal 1 also receives the loworder address bytes during Flash programming and verification.Port 2:Port 2 is an 8bit bidirectional I/O port with internal Port 2 output buffers can sink/source four TTL 1s are written to Port 2 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 2 pins that are externally being pulled low will source current (IIL) because of the internal 2 emits the highorder address byte during fetches from external program memory and during accesses to external data memory that use 16bit addresses (MOVX DPTR). In this application it uses strong internal pullups when emitting 1s. During accesses to external data memory that use 8bit addresses (MOVX RI), Port 2 emits the contents of the P2 Specia。 The winter will accelerate the hot conduction, will make one feel twice as coldly. Obviously humidity to person daily life importance. The humidity is not very only important to the home life39。 Spring the bacterium multiplies, easy to induce the respiratory disease, rheumatism。 The electric appliance and the precision instrument are affected with damp suffer injury。s humidity, relative humidity take 60%~70% as good, the winter should better not be lower than 50%, summer is not bigger than 80%. If the humidity is oversized, extremely easy to cause clothes leather to be affected with damp mildewy。在論文完成之際,我首先謹(jǐn)向在我做畢業(yè)設(shè)計(jì)期間給予我無微不至關(guān)懷的王宇老師致以真誠(chéng)的謝意,然后向在大學(xué)期間向我們傳授知識(shí),提高素質(zhì)的各位遼寧工業(yè)大學(xué)的教師表示感謝,最后對(duì)朝夕相處的同學(xué)在畢業(yè)設(shè)計(jì)期間給予我的支持和幫助送上我深深的謝意。在這段時(shí)間里,不僅大大提高了我的實(shí)踐經(jīng)驗(yàn),也使我學(xué)到了許多書本上不曾接觸的知識(shí),開拓了視野,擴(kuò)大了知識(shí)面,最重要的是學(xué)到了如何利用信息資源幫助自己尋找資料,提高了自己的自學(xué)能力。從最基本的做起,慢慢熟悉到熟練我們的工作,把我們所學(xué)的運(yùn)用到工作中去。而本次設(shè)計(jì)正是鑒于單片機(jī)在這方面的優(yōu)異性能 ,來設(shè)計(jì)一種用單片機(jī)濕度控制系統(tǒng)。由于單片機(jī)的計(jì)數(shù)頻率上限底(12MHz 晶振時(shí)約為 500KHz) ,所以需對(duì)高頻被測(cè)信號(hào)進(jìn)行硬件預(yù)分頻處理,AT89C51 則完成運(yùn)算、控制及顯示功能。本科生畢業(yè)設(shè)計(jì)(論文)25第 5 章 結(jié) 論本次畢業(yè)設(shè)計(jì)是基于單片機(jī)的濕度檢測(cè)系統(tǒng)的設(shè)計(jì),它是最常見的和最典型的過程控制系統(tǒng),本設(shè)計(jì)主要針對(duì) 51 型單片機(jī)在檢測(cè)相對(duì)過程控制方面的應(yīng)用,分析濕度控制系統(tǒng)實(shí)例。開始初始化讀取采樣間隔數(shù)據(jù)采樣時(shí)間到?讀取采樣數(shù)據(jù)AD 轉(zhuǎn)換結(jié)果儲(chǔ)存顯示YN返回圖 數(shù)據(jù)采集子程序流程圖本科生畢業(yè)設(shè)計(jì)(論文)23 鍵盤部分:初始化開始運(yùn)行啟動(dòng) AD 轉(zhuǎn)換設(shè)定鍵按下?顯示當(dāng)前設(shè)定濕度設(shè)定濕度 加一減一確定鍵按下?YNYN返回圖 鍵盤子程序流程圖本科生畢業(yè)設(shè)計(jì)(論文)24 報(bào)警部分:進(jìn)入中斷處理讀取 A/D 轉(zhuǎn)換結(jié)果超出范圍?過高?加濕 除濕報(bào)警延時(shí)程序返回YYNN圖 報(bào)警子程序流程圖主要實(shí)現(xiàn)異常情況下控制告警信號(hào)輸出。需要指出的是,由于74LS164 無并行輸出控制端,因而在串行輸入過程中,其輸出端的狀態(tài)會(huì)不斷變化,造成不應(yīng)顯示的字段仍有較暗的亮度,影響了顯示的效果。在移位時(shí)鐘的作用下,串行口發(fā)送緩沖器的數(shù)據(jù)一位一位地移入74LS164中。 EA/VP31X119 X218RESET9RD17 WR16INT012 INT113T014 T115P101 P12P123 P134P145 P156P167 P178P0 39P01 38P02 37P03 36P04 35P05 34P06 3P07 32P20 21P21 2P2 23P23 24P24 25P25 26P26 27P27 28PSEN 29ALE/P 30TXD 1RXD 10U2AT89C511KR13PFC33PFC2VCU0NOTS1 R220KC12uFVCINT1abfcgdeVC1234567abcdefg8 dp dp9U7abfcgdeVC1234567abcdefg8 dp dp9U6A1 B2 Q0 3Q1 4Q2 5Q3 6Q4 10Q5 1Q6 12Q7 13CLK8 MR9U174LS164A1 B2 Q0 3Q1 4Q2 5Q3 6Q4 10Q5 1Q6 12Q7 13CLK8 MR9U574LS164A1 B2 Q0 3Q1 4Q2 5Q3 6Q4 10Q5 1Q6 12Q7 13CLK8 MR9U874LS164A1 B2 Q0 3Q1 4Q2 5Q3 6Q4 10Q5 1Q6 12Q7 13CLK8 MR9U1074LS164abfcgdeVC1234567abcdefg8 dp dp9U9abfcgdeVC1234567abcdefg8 dp dp9U12VCVC圖 顯示電路與單片機(jī) AT89C51 連接示意圖AT89C51 的 RXD 引腳與驅(qū)動(dòng)芯片 74LS164 的 A,B 引腳相連,TXD 引腳與74LS164 的 CLR 引腳相連,如圖 所示。MR 清除端,為 0 時(shí),輸出清零。 Q0—Q7 并行輸出端 。并帶有清除端。在單片機(jī)系統(tǒng)中, 如果并行口的 IO 資源不夠,而串行口又沒有其他的作用, 那么我們可以用 74LS164 來擴(kuò)展并行 IO 口,節(jié)約單本科生畢業(yè)設(shè)計(jì)(論文)20片機(jī)資源。 顯示電路顯示電路采用 8 位 LED 顯示電路對(duì)濕度值和溫度值進(jìn)行實(shí)時(shí)顯示。本科生畢業(yè)設(shè)計(jì)(論文)19 報(bào)警電路當(dāng)所檢測(cè)室內(nèi)濕度超過或低于所設(shè)定值時(shí),報(bào)警電路便發(fā)出報(bào)警,提醒工作人員對(duì)濕度進(jìn)行控制。在本濕度檢測(cè)系統(tǒng)中,除了把一個(gè)獨(dú)立的按鍵用作開始鍵外,利用了一種新型的鍵盤電路,它可以最大限度地減少鍵盤電路對(duì) I/O 端口的占用。 按鍵電路為了完成預(yù)定濕度值的設(shè)置,系統(tǒng)中設(shè)置了 5 個(gè)按鍵,分別為復(fù)位鍵,加一鍵,減一鍵,設(shè)定鍵和確認(rèn)鍵。A