【正文】
目 錄摘 要 .......................................................................................................................................................................IABSTRACT............................................................................................................................................................II1 引言 .......................................................................................................................................................................12 功能要求 ...............................................................................................................................................................13 方案論證與設計 ...................................................................................................................................................1 控制部分的方案選擇 ....................................................................................................................................1 測溫部分的方案選擇 ....................................................................................................................................1 顯示部分的方案選擇 ....................................................................................................................................24 系統(tǒng)硬件電路設計 ...............................................................................................................................................2 主控器 AT89C52 ..........................................................................................................................................2 時鐘電路 DS1302 .........................................................................................................................................3. DS1302 的性能特性 ..............................................................................................................................3 DS1302 數(shù)據(jù)操作原理 ...........................................................................................................................3 測溫電路的設計 ............................................................................................................................................5 溫度傳感器工作原理 ............................................................................................................................5 DS18B20 與單片機的接口電路 .............................................................................................................8 顯示電路的設計 ............................................................................................................................................9 鍵盤接口的設計 ........................................................................................................................................105 系統(tǒng)程序的設計 .................................................................................................................................................10 陽歷程序設計 ..............................................................................................................................................10 時間調(diào)整程序設計 ......................................................................................................................................11 溫度程序設計 ..............................................................................................................................................12 主程序 ..................................................................................................................................................12 讀出溫度子程序 ..................................................................................................................................12 溫度轉換命令子程序 ..........................................................................................................................12 計算溫度子程序 ..................................................................................................................................13 顯示數(shù)據(jù)刷新子程序 ...........................................................................................................................136 調(diào)試及性能分析 ...............................................................................................................................................13 調(diào)試步驟 ......................................................................................................................................................14 性能分析 ......................................................................................................................................................147 總結 ...................................................................................................................................................................14參考文獻 .................................................................................................................................................................14致 謝 .....................................................................................................................................................................14基于 51 單片機的電子萬年歷的設計摘 要電子萬年歷是單片機系統(tǒng)的一個應用,由硬件和軟件相配合使用。硬件由主控器、時鐘電路、溫度檢測電路、顯示電路、鍵盤接口 5 個模塊組成。主控模塊用 AT89C5時鐘電路用時鐘芯片DS130顯示模塊用 LED 數(shù)碼管、溫度檢測采用 DS18B20 溫度傳感器、鍵盤接口電路用普通按鍵接上拉電阻完成;軟件利用 C 語言編程實現(xiàn)單片機程序控制。單片機通過時鐘芯片 DS1302 獲取時間數(shù)據(jù),DS18B20 采集溫度信號送該給單片機處理,單片機再把時間數(shù)據(jù)和溫度數(shù)據(jù)送給74LS154 譯碼,然后通過三極管 C9015 放大驅(qū)動 LED 數(shù)碼管顯示陽歷年、月、日、時、秒、鬧鐘、星期、溫度。關鍵詞 電子萬年歷;單片機;溫度傳感器;時鐘;數(shù)碼顯示AbstractElectronic perpetual calendar which is an application of the singlechip processor system, is utilized by bining hardware and software. And Hardware is posed of five modules: Main control unit, clock circuit, temperature test circuit, display circuit, keyboard interface. Main control board adopts AT89S52, clock circuit adopts the DS1302 clock chip, display module adopts the LED digital tube, and temperature test adopts the DS18B20 temperature sensor, keyboard interface circuit is pleted by connecting ordinary button with pullu