【正文】
for the job so although the original is still in the pilation of a lot of use. The same token, if the giant puter operating system and applications run up to get home PC, home PC, also can not afford to.Can be said that the twentieth century across the three power era, that is, the age of electricity, the electronic age and has entered into the puter age. However, this puter, usually refers to the personal puter, referred to as PC. It consists of the host, keyboard, monitor and other ponents. Another type of puter, most people do not know how. This puter is to give all kinds of intelligent machines single chip (also known as microcontroller). As the name suggests, this puter system took only a minimal integrated circuit, can be a simple operation and control. Because it is small, usually hidden in the charged mechanical stomach in. It is in the device, like the human brain plays a role, it goes wrong, the whole plant was paralyzed. Now, this microcontroller has a very broad field of use, such as smart meters, realtime industrial control, munications equipment, navigation systems, and household appliances. Once all kinds of products were using SCM, can serve to upgrade the effectiveness of products, often in the product name preceded by the adjective intelligent, such as intelligent washing machines. Now some technical personnel of factories or other amateur electronics developers to engage in out of certain products, not the circuit is too plicated, that function is too simple and can easily be copied. The reason may be stuck in the product did not use a microcontroller or other programmable logic device.SCM historySCM was born in the late 20th century, 70, experienced SCM, MCU, SOC three stages.First model the single chip microputer (Single Chip Microputer) stage, mainly seeking the best of the best single form of embedded systems architecture. Innovation model success, laying the SCM and general puter pletely different path of development. In the open road of independent development of embedded systems, Intel Corporation contributed. the microcontroller (Micro Controller Unit) stage, the main direction of technology development: expanding to meet the embedded applications, the target system requirements for the various peripheral circuits and interface circuits, highlight the object of intelligent involves the areas associated with the object system, therefore, the development of MCU39。致謝四年的讀書(shū)生活在這個(gè)季節(jié)即將劃上一個(gè)句號(hào),而于我的人生卻只是一個(gè)逗號(hào),我將面對(duì)又一次征程的開(kāi)始。p++。}void lcd_char(uchar hang,uchar lie,char date) //行,列,需要輸入1602的數(shù)據(jù)(字符){uchar a。delay_10us()。rs=0。m8。本次設(shè)同時(shí)采用的是手動(dòng)按鈕復(fù)位,而51單片機(jī)都是高電平復(fù)位,當(dāng)RST引腳上出現(xiàn)了兩個(gè)周期以上的高電平就會(huì)出發(fā)內(nèi)部復(fù)位,復(fù)位電路圖 顯示電路在日常生活中,我們對(duì)液晶顯示器并不陌生,它已作為很多電子產(chǎn)品的通過(guò)器件,比方在計(jì)算器、萬(wàn)用表、電子表及很多家用電子產(chǎn)品中都可以看到,顯示的主要是數(shù)字、專用符號(hào)和圖形。手動(dòng)按鈕復(fù)位手動(dòng)按鈕復(fù)位需要人為在復(fù)位輸入端RST上加入高電平。篡位電路都 是比較簡(jiǎn)單的大都是只有電阻和電容組合就可以辦到了。3電路設(shè)計(jì)單片機(jī)是整個(gè)系統(tǒng)的控制中樞,它指揮外圍器件協(xié)調(diào)工作,從而完成特定的功能,硬件實(shí)現(xiàn)上采用模塊化設(shè)計(jì),每一模塊只實(shí)現(xiàn)一個(gè)特定功能,最后將各個(gè)模塊搭接在一起,這種設(shè)計(jì)方法可以降低系統(tǒng)的復(fù)雜性,本系統(tǒng)主要硬件設(shè)計(jì)包括電源電路、晶振電路、LCD顯示電路以及溫濕度傳感器電路 主控制電路及測(cè)溫控制電路設(shè)計(jì)此系統(tǒng)的中樞為AT89C52單片機(jī),其他電路軍事圍繞它所設(shè)計(jì)的。高電平表示有效,低電平則無(wú)效。 管腳功能1602LCD采用標(biāo)準(zhǔn)的14腳(無(wú)背光)或16腳(帶背光)接口。DHT11一旦接收到主機(jī)的開(kāi)始信號(hào),接著就等待開(kāi)始信號(hào)的結(jié)束,然后發(fā)送80us的低電平響應(yīng)信號(hào),要讀取DHT11的響應(yīng)信號(hào),必須等待開(kāi)始信號(hào)的結(jié)束,并延時(shí)等待2040us后才能夠接受,主機(jī)發(fā)送開(kāi)始信號(hào)后,這時(shí)候就可輸出高電平或切換到輸入模式,接著總線由上拉電阻拉高。高濃度的化學(xué)污染會(huì)導(dǎo)致傳感器感應(yīng)層的徹底損壞。C 177。(031H)=52H 聲明為AT89C52 單片機(jī)。定時(shí)器2的可編程時(shí)鐘輸出:定時(shí)器2 輸出一個(gè)占空比為50%的時(shí)鐘信號(hào),如。定時(shí)器2的波特率發(fā)生器:當(dāng)T2CON中的TCLK 和RCLK 置位時(shí),定時(shí)/計(jì)數(shù)器2 作為波特率發(fā)生器使用。為確保采樣的正確性,要求輸入的電平在變化前至少保持一個(gè)完整周期的時(shí)間,以保證輸入信號(hào)至少被采樣一次。時(shí)鐘電路一般由晶體震蕩器、晶震控制芯片和電容組成。 主要功能特點(diǎn)和優(yōu)越性(1)4k Bytes Flash片內(nèi)程序存儲(chǔ)器;(2)128 bytes的隨機(jī)存取數(shù)據(jù)存儲(chǔ)器(RAM);(3)32個(gè)外部雙向輸入/輸出(I/O)口;(4)5個(gè)中斷優(yōu)先級(jí)、2層中斷嵌套中斷;(5)6個(gè)中斷源;(6)2個(gè)16位可編程定時(shí)器/計(jì)數(shù)器;(7)2個(gè)全雙工串行通信口;(8)看門狗(WDT)電路;(9)片內(nèi)振蕩器和時(shí)鐘電路;(10)與MCS51兼容;(11)全靜態(tài)工作:0Hz33MHz;(12)三級(jí)程序存儲(chǔ)器保密鎖定;(13)可編程串行通道;(14)低功耗的閑置和掉電模式。該位置位后,只有一條MOVX 和MOVC指令才能將ALE 激活。對(duì)端口P2 寫(xiě)“1”,通過(guò)內(nèi)部的上拉電阻把端口拉到高電平,此時(shí)可作輸入口,作輸入口使用時(shí),因?yàn)閮?nèi)部存在上拉電阻,某個(gè)引腳被外部信號(hào)拉低時(shí)會(huì)輸出一個(gè)電流(IIL)。本實(shí)驗(yàn)使用的是當(dāng)前常用的51系列單片機(jī)ATMEL的89C52,AT89C52是一個(gè)低電壓,高性能CMOS 8位單片機(jī),片內(nèi)含8k bytes的可反復(fù)擦寫(xiě)的Flash只讀程序存儲(chǔ)器和256 bytes的隨機(jī)存取數(shù)據(jù)存儲(chǔ)器(RAM),器件采用ATMEL公司的高密度、非易失性存儲(chǔ)技術(shù)生產(chǎn),兼容標(biāo)準(zhǔn)MCS51指令系統(tǒng),片內(nèi)置通用8位中央處理器和Flash存儲(chǔ)單元,AT89C52單片機(jī)在電子行業(yè)中有著廣泛的應(yīng)用。 功能特性兼容MCS51指令系統(tǒng)8kB可反復(fù)擦寫(xiě)(大于1000次)Flash ROM;32個(gè)雙向I/O口;256x8bit內(nèi)部RAM;3個(gè)16位可編程定時(shí)/計(jì)數(shù)器中斷;時(shí)鐘頻率024MHz; 2個(gè)串行中斷,可編程UART串行通道;2個(gè)外部中斷源,共8個(gè)中斷源;2個(gè)讀寫(xiě)中斷口線,3級(jí)加密位;低功耗空閑和掉電模式,軟件設(shè)置睡眠和喚醒功能;1有PDIP、PQFP、TQFP及PLCC等幾種封裝形式,以適應(yīng)不同產(chǎn)品的需求。在訪問(wèn)外部程序存儲(chǔ)器或16 位地址的外部數(shù)據(jù)存儲(chǔ)器(例如執(zhí)行MOVX DPTR 指令)時(shí),P2 口送出高8 位地址數(shù)據(jù)。此外,該引腳會(huì)被微弱拉高,單片機(jī)執(zhí)行外部程序時(shí),應(yīng)設(shè)置ALE 禁止位無(wú)效。 中斷系統(tǒng)程序執(zhí)行過(guò)程中,允許外部或內(nèi)部事件通過(guò)硬件打斷程序的執(zhí)行,使其轉(zhuǎn)向?yàn)樘幚韮?nèi)部事件的中斷服務(wù)程序中去;完成中斷服務(wù)的程序后,CPU繼續(xù)原來(lái)被打斷的程序,這樣的過(guò)程稱為中斷過(guò)程。時(shí)鐘電路應(yīng)用十分廣泛,如電腦的時(shí)鐘電路、電子表的時(shí)鐘電路以及MPMP4的時(shí)鐘電路。定時(shí)器2的捕捉方式:在捕獲方式下,通過(guò)T2CON 控制位EXEN2 來(lái)選擇兩種方式。如果定時(shí)/計(jì)數(shù)器2 作 為發(fā)送器或接收器,其發(fā)送和接收的波特率可以是不同的,定時(shí)器1 用于其它功能。 引腳除了是一個(gè)標(biāo)準(zhǔn)的I/O 口外,還可以通過(guò)編程使其作為定時(shí)/計(jì)數(shù)器2 的外部時(shí)鐘輸入和輸出占空比50%的時(shí)鐘脈沖。(032H)=FFH 聲明為12V 編程電壓。5%RH互 換 性:可完全互換響應(yīng)時(shí)間:1/e(63%)25176。3恢復(fù)處理置于極限工作條件下或化學(xué)蒸汽中的傳感器,通過(guò)如下處理程序,可使其恢復(fù)到校準(zhǔn)時(shí)的狀態(tài)。DHT11發(fā)送響應(yīng)信號(hào)的時(shí)候總線為低電平 ,DHT11把總線拉高80us之前,必須等到響應(yīng)信號(hào)發(fā)送,準(zhǔn)備發(fā)送數(shù)據(jù)時(shí),每一bit數(shù)據(jù)都以50us低電平時(shí)隙開(kāi)始,數(shù)據(jù)位是0或1是由高電平的長(zhǎng)或短來(lái)決定。第1腳:VSS為地電源。指令4:顯示開(kāi)關(guān)控制。顯示電路就是把LCD1602顯示屏和單片機(jī)P0口分別連接在一起,為了增加單片機(jī)的輸出能了,增加單片機(jī)的輸出電流,故將排阻與單片機(jī)的P0口分別連接在一起。再?gòu)?fù)雜點(diǎn)就有三極管等等配合程序來(lái)進(jìn)行了。一般采用的辦法是在RST端和正電源Vcc之間接一個(gè)按鈕。顯示模塊選用1602字符型液晶模塊,它是目前工控系統(tǒng)中使用最廣泛的液晶屏之一,由于它顯示的質(zhì)量高, 1602字符型液晶模塊是點(diǎn)陣型液晶,驅(qū)動(dòng)方便,顯示電路圖 傳感器電路DHT11傳感器是數(shù)字型溫濕度傳感器,可直接以數(shù)字的方式傳輸所采集的當(dāng)前環(huán)境溫濕度,DHT11傳感器采用的是單總線通信,因此只需將單片機(jī)的一個(gè)I/O端口與DHT11的通信借口連接就可以實(shí)現(xiàn)數(shù)據(jù)的采集和傳送,相對(duì)于其他電路來(lái)說(shuō)比較簡(jiǎn)單【1】。m++){ while (!dp)。rw=1。en=0。if(hang==1) a=0x80。}} 延時(shí)程序void delay(uint i) /*延時(shí)i/10 ms*/{uchar y。四年的求學(xué)生涯在師長(zhǎng)、親友的大力支持下,走得辛苦卻也收獲滿囊,在論文即將付梓之際,思緒萬(wàn)千,心情久久不能平靜。s responsibility inevitably falls on electrical, electronics manufacturers. From this point of view, Intel faded MCU development has its objective factors. In the development of MCU, the most famous manufacturers as the number of Philips Corporation. Philips pany in embedded applications, its great advantage, the MCS51 singlechip microputer from the rapid development of the microcontroller. Therefore, when we look back at the path of development of embedded systems, do not forget Intel and Philips in History. Embedded System