可編程作息時(shí)間控制器設(shè)計(jì)與制作.doc
可編程作息時(shí)間控制器設(shè)計(jì)與制作,摘 要:本文介紹了一款基于at89s52單片機(jī)數(shù)字鐘的設(shè)計(jì),通過多功能數(shù)字鐘的設(shè)計(jì)思路,詳細(xì)敘述了系統(tǒng)硬件、軟件的具體實(shí)現(xiàn)過程。論文重點(diǎn)闡述了數(shù)字鐘硬件中主控制模塊、時(shí)鐘模塊、顯示模塊和相關(guān)控制模塊等的模塊化設(shè)計(jì)與制作;軟件同樣采用模塊化的設(shè)計(jì), 本設(shè)計(jì)實(shí)現(xiàn)了時(shí)間與鬧鐘的修改功能、語音播報(bào)...
內(nèi)容介紹
此文檔由會(huì)員 lutuozhe 發(fā)布可編程作息時(shí)間控制器設(shè)計(jì)與制作
摘 要:
本文介紹了一款基于AT89S52單片機(jī)數(shù)字鐘的設(shè)計(jì),通過多功能數(shù)字鐘的設(shè)計(jì)思路,詳細(xì)敘述了系統(tǒng)硬件、軟件的具體實(shí)現(xiàn)過程。論文重點(diǎn)闡述了數(shù)字鐘硬件中主控制模塊、時(shí)鐘模塊、顯示模塊和相關(guān)控制模塊等的模塊化設(shè)計(jì)與制作;軟件同樣采用模塊化的設(shè)計(jì), 本設(shè)計(jì)實(shí)現(xiàn)了時(shí)間與鬧鐘的修改功能、語音播報(bào)功能、年、月、日和星期等的顯示功能。并且通過對比實(shí)際的時(shí)鐘,查找出了誤差的來源,確定了調(diào)整誤差的方法,盡可能的減少誤差,使得系統(tǒng)可以達(dá)到實(shí)際數(shù)字鐘的允許誤差范圍內(nèi)。
本次設(shè)計(jì)過程在硬件與軟件方面是進(jìn)行同步設(shè)計(jì)。硬件部分主要由AT89C52單片機(jī),LED顯示電路,以及調(diào)時(shí)按鍵電路等組成。在單片機(jī)的選擇上本人使用了AT89C52單片機(jī),該單片機(jī)適合于許多較為復(fù)雜控制應(yīng)用場合。顯示器使用2片7SEG-MPX8-CA和一片7SEG-MPX4-CA。7SEG-MPX8-CA是一種八個(gè)共陽二極管顯示器,7SEG-MPX4-CA是一種四個(gè)共陽二極管顯示器。為了能更輕松的控制這三片顯示器,本人使用了3片74HC164來驅(qū)動(dòng)。74HC164 是 8 位邊沿觸發(fā)式移位寄存器,串行輸入數(shù)據(jù),然后并行輸出。軟件方面主要包括日歷程序、時(shí)間調(diào)整程序,公歷轉(zhuǎn)陰歷程序,顯示程序等。程序采用匯編語言編寫,以便更簡單地實(shí)現(xiàn)調(diào)整時(shí)間及陰歷顯示功能。
關(guān)鍵詞:
ABSTRACT
This article describes an AT89S52 microcontroller based digital clock design, through multi-functional digital clock design ideas, detailed description of the system hardware and software realization process. Paper focuses on the digital clock in the main control module hardware, the clock modules, display modules and associated control modules, modular design and production; software as modular design, the design and implementation of the changes of time and alarm functions, voice broadcast function, year, month, day and week, etc. display. And by comparing the actual clock, find out the source of the error, the error of the method of determining the adjustment, as much as possible to reduce errors
Enable the system to achieve a practical digital clock within allowable error.
Hardware mainly by the AT89C52 microcontroller, LED display circuit, and the tune composed of the circuit when the button. In the SCM choice I used the AT89C52 microcontroller, which is suitable for many of the more complex control applications. Monitor the use of two 7SEG--MPX8--CA and a 7SEG--MPX4--CA. 7SEG-MPX8-CA is a total of eight-yang display 7SEG-MPX4-CA is a total of four-yang diode display. In order to more easily control the three monitors, I use three 74HC164 to drive.74HC164 is an 8-bit edge-triggered shift register, serial input data, and parallel output. The software includes calendar program, time to adjust procedures, turn the lunar calendar programs display programs. Programs written in assembly language used in order to more easily adjust the time and the realization of the lunar calendar display. All programming is complete, the wave software debugging,
Key words:
Clock electric clock:DS1302;DS18B20:DYNAMIC ;SCANSCM
目 錄
摘要……………………………………………………………………6
ABSTRACT………………………………………………………………7
前言……………………………………………………………………10
一. 設(shè)計(jì)要求與方案探討 …………………………………………………11
1.1 設(shè)計(jì)目的與意義 …………………………………………………………………………10
1.2 設(shè)計(jì)要求 …………………………………………………………………………………11
1.3 系統(tǒng)基本方案選擇探討 ………………………………………………………………11
1.3.1主控制芯片的選擇方案探討 ………………………………………………………11
1.3.2 時(shí)鐘芯片的選擇方案探討 …………………………………………………………12
1.3. 3 LED顯示系統(tǒng)選擇方案探討 ………………………………………………………13
二.硬件設(shè)計(jì)……………………………………………………………14
2.1系統(tǒng)電路設(shè)計(jì)框圖 ………………………………………………………………………14
2.2 系統(tǒng)硬件設(shè)計(jì)概述 ……………………………………………………………………14
2.3系統(tǒng)主要基本單元電路的設(shè)計(jì)……………………………………………………………………14
2.3.1主控制系統(tǒng)電路的設(shè)計(jì) ……………………………………………………………14
2.3.2時(shí)鐘電路的設(shè)計(jì) ………………………………………………………………………16
2.3.3 LED顯示電路的設(shè)計(jì) …………………………………………………………………… 17
2. 4 系統(tǒng)電路原理說明 ………………………………………………………………18
三、軟件設(shè)計(jì) …………………………………………………………22
3.1程序流程框圖 ……………………………………………………………………………22
3.2 子程序的設(shè)計(jì) ……………………………………………………………………………24
3.2.1 讀、寫DS1302子程序 ………………………………………………………………25
四、硬件與軟件調(diào)試………………………………………………………2
4.1硬件調(diào)試 …………………………………………………………………………………25
4.2軟件調(diào)試……………………………………………………………………………………27
4.3調(diào)試結(jié)果分析與結(jié)論………………………………………………………………………29
4.3.1 調(diào)試結(jié)果分析…………………………………………………………………………29
4.3.2 調(diào)試結(jié)論………………………………………………………………………………29
五、論文總結(jié) ……………………………………………………………30
參考文獻(xiàn)…………………………………………………………………30
附錄一:系統(tǒng)電路圖…………………………………………………………31
附錄二:系統(tǒng)程序清單 ……………………………………………………32
致謝 …………………………………………………………………50