【正文】
數(shù)碼管相比功耗較小,硬件連接簡(jiǎn)單。 顯示模塊選擇方案和論證:方案一:采用點(diǎn)陣式數(shù)碼管顯示,點(diǎn)陣式數(shù)碼管是由八行八列的發(fā)光二極管組成,對(duì)于顯示文字比較適合,如采用在顯示數(shù)字顯得太浪費(fèi),且價(jià)格也相對(duì)較高,所以也不用此種作為顯示。當(dāng)在對(duì)電路進(jìn)行調(diào)試時(shí),由于程序的錯(cuò)誤修改或?qū)Τ绦虻男略龉δ苄枰獰氤绦驎r(shí),不需要對(duì)芯片多次拔插,所以不會(huì)對(duì)芯造成損壞。AT89C單片機(jī)為很多嵌入式控制系統(tǒng)提供了一種靈活性高且價(jià)廉的方案。該器件采用ATMEL高密度非易失存儲(chǔ)器制造技術(shù)制造,與工業(yè)標(biāo)準(zhǔn)的MCS51指令集和輸出管腳相兼容。AT89C2051是一種帶2K字節(jié)閃爍可編程可擦除只讀存儲(chǔ)器的單片機(jī)。由于構(gòu)成的應(yīng)用系統(tǒng)是一個(gè)計(jì)算機(jī)系統(tǒng),相當(dāng)多的測(cè)、控功能由軟件實(shí)現(xiàn),故具有柔性特征,不須改變硬件系統(tǒng)就能適當(dāng)?shù)馗淖兿到y(tǒng)功能。這些可靠性的獲得除了依靠單片機(jī)芯片本身的高可靠性以及應(yīng)用有最少的聯(lián)接外,還可以方便地采用軟、硬件技術(shù)。因此,只要外加一些擴(kuò)展電路及必要的通道接口就可以構(gòu)成各種計(jì)算機(jī)應(yīng)用系統(tǒng),如工業(yè)控制系統(tǒng)、數(shù)據(jù)采集系統(tǒng)、自動(dòng)測(cè)試系統(tǒng)、萬(wàn)年歷電子表等。集成技術(shù)的最新發(fā)展之一是將CPU和外圍芯片,如程序存儲(chǔ)器、數(shù)據(jù)存儲(chǔ)器、并行、串行I/O口、定時(shí)/計(jì)數(shù)器、中斷控制器及其他控制部件集成在一個(gè)芯片之中,制成單片計(jì)算機(jī)(SingleChip Microputer)。采用LCD顯示年、月、日、時(shí)、分、秒、星期,并具備以下功能:① 具備年、月、日、星期、時(shí)、分、秒校準(zhǔn)功能;② 設(shè)置按鍵為選擇,按鍵為加,按鍵為減,按鍵為確定;③ 自動(dòng)將日期時(shí)間調(diào)整控制在合理范圍內(nèi),星期調(diào)整會(huì)在調(diào)整年月日時(shí)自動(dòng)完成;④ 星期及時(shí)間信息,調(diào)整時(shí)鐘時(shí),所選擇的調(diào)整對(duì)象反白顯示。AbstractEcalendarbedroom at home,schools,stations and more extensive use of plaza for people’s lives,study,work great calendar for the past need to readjust after poweroff time and date,and time is a big error,Designed the system using realtime clock chip(DS1302) as a time parts,the chip es with an internal crystal oscillator,so that effectively guarantee the accuracy of the time and hang own internal battery power makes the situation will continue to update the time design uses AT89C51 as the main controller,in order to improve the practicality of the cricuit add temperature measurement circuit ,timekeeping and alarm funtinons. Ecalendar day time is a very wide range of tools, increasingly popular in modern society. It can be year, month, day, Sunday, hours, minutes, seconds for time, but also has a leap year pensation to a variety of functions, and the DS130239。在單片機(jī)的選擇上本人使用了AT89C51單片機(jī),該單片機(jī)適合于許多較為復(fù)雜控制應(yīng)用場(chǎng)合。萬(wàn)年歷的設(shè)計(jì)過(guò)程在硬件與軟件方面進(jìn)行同步設(shè)計(jì)。在硬件與軟件設(shè)計(jì)時(shí),沒(méi)有良好的基礎(chǔ)知識(shí)和實(shí)踐經(jīng)驗(yàn)會(huì)受到很大限制,每項(xiàng)功能實(shí)現(xiàn)時(shí)需要那種硬件,程序該如何編寫(xiě),算法如何實(shí)現(xiàn)等,沒(méi)有一定的基礎(chǔ)就不可能很好的實(shí)現(xiàn)。本設(shè)計(jì)是基于51系列的單片機(jī)進(jìn)行的電子萬(wàn)年歷設(shè)計(jì),可以顯示年月日時(shí)分秒及周信息,具有可調(diào)整日期和時(shí)間功能。對(duì)于數(shù)字電子萬(wàn)年歷采用直觀的數(shù)字顯示,可以同時(shí)顯示年、月、日、周日、時(shí)、分、秒和溫度等信息,還具有時(shí)間校準(zhǔn)等功能。電子萬(wàn)年歷是一種非常廣泛日常計(jì)時(shí)工具,對(duì)現(xiàn)代社會(huì)越來(lái)越流行。本系統(tǒng)設(shè)計(jì)采用了實(shí)時(shí)芯片(DS1302)作為計(jì)時(shí)器件,該芯片內(nèi)部自帶晶振蕩器,這樣就有效的保證了計(jì)時(shí)的精確性,并且內(nèi)部自帶電池使得在斷電的情況下能夠繼續(xù)的更新時(shí)間信息。 摘 要現(xiàn)代電子萬(wàn)年歷在家庭居室、學(xué)校、車站和廣場(chǎng)使用的越來(lái)越廣泛,給人們的生活、學(xué)習(xí)、工作帶來(lái)了極大的方便。針對(duì)以往的電子萬(wàn)年歷斷電后的需要重新調(diào)整時(shí)間與日期,并且計(jì)時(shí)誤有差現(xiàn)象。本設(shè)計(jì)采用了AT89C51作為主要控制器,為了提高電路的使用性加入了報(bào)時(shí)和鬧鐘功能。它可以對(duì)年、月、日、周日、時(shí)、分、秒進(jìn)行計(jì)時(shí),還具有閏年補(bǔ)償?shù)榷喾N功能,而且DS1302的使用壽命長(zhǎng),誤差小。該電路采用AT89C51單片機(jī)作為核心,功耗小,能在3V的低壓工作,電壓可選用3~5V電壓供電。在設(shè)計(jì)的同時(shí)對(duì)單片機(jī)的理論基礎(chǔ)和外圍擴(kuò)展知識(shí)進(jìn)行了比較全面準(zhǔn)備。在編寫(xiě)程序過(guò)程中發(fā)現(xiàn)以現(xiàn)有的相關(guān)知識(shí)要獨(dú)自完成編寫(xiě)任務(wù)困難重重,在老師和同學(xué)的幫助下才完成了程序部分的編寫(xiě)。硬件部分主要由AT89C51單片機(jī),LCD顯示電路,以及調(diào)時(shí)按鍵電路等組成。最后總在老師同學(xué)的幫助以及自己的努力下完成了此次電子萬(wàn)年歷的設(shè)計(jì)。s long life, small error. For the digital electronic calendar using an intuitive digital display can simultaneously display year, month, day, Sunday, hours, minutes, seconds, and temperature and other information, but also a timecalibration and other functions. The circuit uses AT89C51 microcontroller as the core, power consumption, lowvoltage work in 3V, the voltage can choose 3 ~ 5V voltage supply.The design is based on 51 series of microcontrollers to the design of electronic calendar, you can display date information on when the minutes and seconds, and weeks, with adjustable date and time functions. At the same time in the design of the theoretical basis of the MCU and peripheral expansion of knowledge of the more prehensive preparation. The hardware and software design, there is no good basic knowledge and practical experience will be greatly limited, each feature is required to achieve the kind of hardware, procedures, how to write, how to implement such algorithms, there is no certain foundation can not be good implementation. Found during the preparation process to the existing knowledge to plete the preparation of the task alone difficult,In the help of teachers and students to plete the program part of the preparation.Calendar of the design process in hardware and software to synchronize the design. Hardware mainly by the AT89C51 microcontroller, LED display circuit, and the tune posed of the circuit when the button. In the SCM choice I used the AT89C51 microcontroller, which is suitable for many of the more plex control applications. The final overall the teacher to help students, as well as their own efforts to plete the design of the electronic calendar.目錄【摘要】…………………………………………………………………………………...............1第一章、設(shè)計(jì)要求與方案論證 設(shè)計(jì)要求……………………………………………………………………………………..5 系統(tǒng)基本方案選擇和論證…………………………………………………………………...5………………………………………………………..5 顯示模塊選擇方案和論證……………………………………………………………..6…………………………………………………………...6 電路設(shè)計(jì)最終方案決定………………………………………………………………………7第二章、系統(tǒng)的硬件設(shè)計(jì)與實(shí)現(xiàn) 電路設(shè)計(jì)框圖………………………………………………………………………………...7………………………………………………………………………….7…………………………………………………………………...7………………………………………………………………………...10…………………………………………………………………..………….13…………………………………………………………………………….14 晶振電路………………………………………………………………………….….15第三章、日歷算法……………………………………………………………………………16第四章、系統(tǒng)的軟件設(shè)計(jì)……………………………………………………………………………..….18第五章、軟件仿真……………………………………………………………………………………...21……………………………………………………………………………...22第六章、總結(jié)…………………………………………………………………………….……….23參考文獻(xiàn) ……………………………………………………………………………..……. .24致謝………………………………………………………………………………………………..25附錄一:系統(tǒng)程序清單…………………………………………………………………………..26第一章、設(shè)計(jì)要求與方案論證 設(shè)計(jì)要求:設(shè)計(jì)一個(gè)能夠顯示年、月、日、時(shí)、分、秒、星期功能的數(shù)字萬(wàn)年歷。 系統(tǒng)基本方案選擇和論證:隨著國(guó)內(nèi)超大規(guī)模集成電路的出現(xiàn),微處理器及其外圍芯片有了迅速的發(fā)展。而近年來(lái)推出的一些高檔單片機(jī)還包括有許多特殊功能單元,如A/D、D/A轉(zhuǎn)換器、調(diào)制解調(diào)器、通信控制器、鎖相環(huán)、DMA、浮點(diǎn)運(yùn)算單元等。單片機(jī)的出現(xiàn),并在各個(gè)技術(shù)領(lǐng)域中得到如此迅猛的發(fā)展,與單片機(jī)構(gòu)成計(jì)算機(jī)應(yīng)用系統(tǒng)所形成的下述特點(diǎn)有關(guān):?jiǎn)纹瑱C(jī)構(gòu)成的應(yīng)用系統(tǒng)有較大的可靠性。系統(tǒng)擴(kuò)展、系統(tǒng)配置較典型、規(guī)范,容易構(gòu)成各種規(guī)模的應(yīng)用系統(tǒng),應(yīng)用系統(tǒng)有較高的軟、硬件利用系數(shù)。顧本次選擇單片機(jī)作為核心處理器,并且做了以下比較:片方案一: 采用89C51是一種帶4K字節(jié)閃爍可編程可擦除只讀存儲(chǔ)器的低電壓,高性能CMOS 8位微處理器,俗稱單片機(jī)。單片機(jī)的可擦除只讀存儲(chǔ)器可以反復(fù)擦除100次。由于將多功能8位CPU和閃爍存儲(chǔ)器組合在單個(gè)芯片中,ATMEL的AT89C51是一種高效微控制器,AT89C2051是它的一種精簡(jiǎn)版本。方案二: 采用STC89C52,片內(nèi)ROM全都采用Flash ROM;能以3V的超底壓工作;同時(shí)也與MCS51系列單片機(jī)完全該芯片內(nèi)部存儲(chǔ)器為8KB ROM 存儲(chǔ)空間,同樣具有89C51的功能,且具有在線編程可擦除技術(shù),對(duì)所下載的程序能夠加密,比較安全。由于實(shí)驗(yàn)室AT89C51比較多而且比較實(shí)惠顧選擇AT89C51。方案二:采用LED數(shù)碼管動(dòng)態(tài)掃描,雖然LED數(shù)碼管價(jià)格適中,但要顯示多個(gè)數(shù)字所需要的個(gè)數(shù)偏多,功耗較大,所以也不用此種作為顯示。所以顯示部分采用LCD12864(不含字庫(kù))液晶。采用此種方案雖然減少芯片的使用,節(jié)約成本,但是,實(shí)現(xiàn)的時(shí)間誤差較大。方案二:采用DS1302時(shí)鐘芯片實(shí)現(xiàn)時(shí)鐘,DS1302芯片是一種高性能的時(shí)鐘芯片,可自動(dòng)對(duì)秒、分、時(shí)、日、周、月、年以及閏年補(bǔ)償?shù)哪赀M(jìn)行計(jì)數(shù),而且精度高,位的RAM做為數(shù)據(jù)暫存區(qū),~。 DS1302提供時(shí)鐘。第二章、系統(tǒng)的硬件設(shè)計(jì)與實(shí)現(xiàn)