【正文】
令,當(dāng)溫度低于溫度下限或高于溫度上限時執(zhí)行開空調(diào)命令,開關(guān)器件為兩個大功率電磁繼電器。本文以 STCC89C52 為控制芯片, DS1302 為時鐘芯片, DS18B20 為溫度傳感器, HS0038 紅外一體接收頭作為紅外接收器,以此接收并處理遙控器按鍵信號并用來矯正時鐘時間。 關(guān)鍵詞 :紅外遙控 , 單片機, DS1302, DS18B20, LCD12864Abstract II ABSTRACT With the development of science and technology, especially the development of microelectronics technology, SCM applications have been deeply into all areas of life. Taking STCC89C52 as control chip, for DS1302 clock chip, DS18B20 as temperature collector, HS0038 infrared receiving head as integrated infrared receiver, signal receiving and processing the remote control buttons, in order to correct the clock time. At the same time, the project also joined the function of timing, and setting temperature of upper and lower, executive orders open to turn off the lights when preset time is reached, when the temperature lower than the temperature is lower or higher than the temperature limit mand execution open air conditioning, for electromagic relay switch device. The whole project all the data shown in LCD12864 LCD, forming a good user interface. Made in Protel99SE, the hardware circuit diagram and PCB software development environment for KeilV3, project physical for universal plate welding circuit, through debugging functions are normal. Key words:infrared remote control, microcontroller, DS1302, DS18B20, LCD12864目 錄 III 目 錄 第 1 章 緒 論 ...................................................................................................................1 第 2 章 單片機介紹 .........................................................................................................1 單片機簡介及歷史 .................................................................................................1 單片機應(yīng)用發(fā)展趨勢 .............................................................................................2 第 3 章 硬件設(shè)計 .............................................................................................................2 STC89C52 單片機介紹 ...........................................................................................2 STC89C52 引腳簡介 ........................................................................................2 STC89C52RC 主要功能特點 ...........................................................................4 DS18B20 溫度傳感器介紹 .....................................................................................5 DS18B20 引腳及特點 ......................................................................................5 DS18B20 內(nèi)部結(jié)構(gòu)及寄存器介紹 ..................................................................7 DS1302 時鐘芯片介紹 ............................................................................................9 DS1302 引腳及內(nèi)部寄存器簡介 .....................................................................9 DS1302 讀寫時序 ...........................................................................................10 HS0038 紅外一體接收器介紹 .............................................................................. 11 HS0038 特點介紹 ........................................................................................... 11 HS0038 電路及應(yīng)用 ....................................................................................... 11 LCD12864 液晶介紹 .............................................................................................12 LCD12864 性能概述及引腳功能 ..................................................................12 LCD12864 讀寫時序及用戶指令集 ..............................................................13 其他硬件電路 .......................................................................................................14 STC89C52RC 最小系統(tǒng)的設(shè)計 .....................................................................14 系統(tǒng)電源電路的設(shè)計 ....................................................................................15 第 4 章 軟件開發(fā)平臺及軟件 .......................................................................................15 開發(fā)環(huán)境介紹及程序總體結(jié)構(gòu) ...........................................................................15 開發(fā)環(huán)境介紹 ................................................................................................15 程序總體結(jié)構(gòu) ................................................................................................15 DS18B20 溫度程序模塊 .......................................................................................16 DS18B20 操作流程 ........................................................................................16 DS18B20 部分程序代碼 ................................................................................17 DS1302 時間程序模塊 ..........................................................................................20 DS1302 總體操作及基本讀寫功能函數(shù) .......................................................20 讀取時間數(shù)據(jù)并轉(zhuǎn)化成字符串 ....................................................................23 LCD12864 液晶驅(qū)動程序 .....................................................................................24 LCD12864 初始化 ..........................................................................................24 目 錄 IV 寫數(shù)據(jù)到 LCD12864 功能函數(shù) ....................................................................25 HS0038 紅外解碼程序模塊 ..................................................................................26 紅外遙控器編碼介紹 ....................................................................................26 紅外解碼程序流程及重要代碼分析 ............................................................27 定時定溫功能的程序?qū)崿F(xiàn) ...................................................................................29 第 5 章 系統(tǒng)調(diào)試及項目總結(jié) .......................................................................................33 系統(tǒng)調(diào)試 ...............................................................................................................33 最小系統(tǒng)調(diào)試 ................................................................................................33 其他各模塊調(diào)試過程 ..................