【正文】
with DALLAS small current charging function real time clock chip, low power consumption, it can be years , month, date, day, hour, minute, seconds time, also has a leap year pensation and other functions, and DS1302 long life, small error。所有程序編寫完成后,在 Keil軟件中進(jìn)行調(diào)試,確定沒有問題后,在 Proteus軟件中嵌入單片機(jī)內(nèi)進(jìn)行仿真。該電子萬年歷在硬件方面主要采用 AT89C51 單片機(jī)作為主控核心,由 DS1302時(shí)鐘芯片提供時(shí)鐘、 1602LCM 點(diǎn)陣液晶顯示屏顯示。 AT89C51 單片機(jī)是由 Atmel 公司推出的,功耗小,電壓可選用 4~ 6V 電壓供電; DS1302 時(shí)鐘芯片是美國(guó) DALLAS 公司推出的具有涓細(xì)電流充電功能的低功耗實(shí)時(shí)時(shí)鐘芯片,它可 以對(duì)年、月、日、星期、時(shí)、分、秒進(jìn)行計(jì)時(shí),還具有閏年補(bǔ)償?shù)榷喾N功能,而且 DS1302 的使用壽命長(zhǎng),誤差?。粩?shù)字顯示是采用的 LED 液晶顯示屏來顯示,可以同時(shí)顯示年、月、日、星期、時(shí)、分、秒等信息。 論文主要研究了液晶顯示器 LCM及時(shí)鐘芯片 DS1302,溫度傳感器 DS18B20 與單片機(jī)之間的硬件互聯(lián)及通信,對(duì)數(shù)種 硬件連接方案進(jìn)行了詳盡的比較,在軟件方面對(duì)日歷算法也進(jìn)行了論述。 LED digital display is used in LCD displays that can display in , month, day, week, hours, minutes, seconds and other addition, the electronic calendar is also a time calibration functions. In terms of software, including calendar program, time to adjust procedures, display procedures. All programming is plete, the Keil software debugging, make sure there is no problem, in the Proteus software embedded within the simulated MCU. This article focus on liquid crystal screen LCM1602 and clock chip DS1302,temperature sensor DS18B20 which connected and municated with solutions will also pared with each software side, calender calculation will be discussed as well. The results are as follows:as electronic calender are widely used in our daily should be chip and convenient so as to win more profit. Keyword: Microcontroller,DS1302; DS18B20; LCD1602 目 錄 前言 ........................................................................................................................................ 3 1 方案設(shè)計(jì) .............................................................................................................................. 4 概述 ........................................................................................................................... 4 實(shí)時(shí)時(shí)鐘 研究的背景及意義 .............................................................................. 4 系統(tǒng)的總體設(shè)計(jì) ................................................................................................ 5 系統(tǒng)基本方案選擇和論證 ............................................................................................ 6 單片機(jī)芯片的選擇 ............................................................................................ 6 顯示模塊選擇方案和論證 .................................................................................. 6 時(shí)鐘芯片的選擇方案和論證 .............................................................................. 6 電路設(shè)計(jì)最終方案決定 ..................................................................................... 7 2 硬件電路設(shè)計(jì) ....................................................................................................................... 7 系統(tǒng)硬件概述 ............................................................................................................. 7 單片機(jī)最小系統(tǒng) .......................................................................................................... 8 單片機(jī)的復(fù)位電路 ...................................................................................................... 9 時(shí)鐘芯片電路 ............................................................................................................ 11 時(shí)鐘芯片引腳介紹 ........................................................................................... 11 時(shí)鐘芯片 DS1302 介紹 .....................................................................................12 1602LCD 液晶顯示屏 ..................................................................................................13 1602 字符型 LCD 簡(jiǎn)介 ......................................................................................13 1602 引腳功能說明 .........................................................................................13 蜂鳴器鬧鈴電路 .........................................................................................................14 按鍵調(diào)整電路 ............................................................................................................14 淮南師范學(xué)院電氣信息工程學(xué)院 2020 屆通信工程專業(yè)畢業(yè)論文 第 3 頁 顯示模塊 ...................................................................................................................15 3 軟件部分設(shè)計(jì) ......................................................................................................................16 程序流程框圖 ............................................................................................................16 時(shí)間設(shè)置子程序流程 ..................................................................................................16 程序設(shè)計(jì)問題 ............................................................................................................17 按鍵抖動(dòng)問題 ..................................................................................................17 蜂鳴器設(shè)置 ......................................................................................................18 液晶顯示的設(shè)置 ...............................................................................................18 中斷設(shè)置 .........................................................................................................18 時(shí)鐘芯片設(shè)置 ..................................................................................................19 4 開發(fā)工具 Proteus 與 Keil ......................................................................................................21 Proteus 軟件 ................................................................................................................21 Proteus 簡(jiǎn)介 ......................................................................................................21 4 大功能模塊 ....................................................................................................22 ISIS 智能原理圖輸入系統(tǒng) ..............................................................