專注電子技術(shù)學(xué)習(xí)與研究
當(dāng)前位置:單片機(jī)教程網(wǎng) >> MCU設(shè)計(jì)實(shí)例 >> 瀏覽文章

單片機(jī)電子時(shí)鐘設(shè)計(jì)

作者:佚名   來(lái)源:本站原創(chuàng)   點(diǎn)擊數(shù):  更新時(shí)間:2007年06月14日   【字體:

介紹了多功能數(shù)字鐘的系統(tǒng)設(shè)計(jì)。系統(tǒng)具有時(shí)間設(shè)置及顯示、鬧鐘、溫度顯示等功能。系統(tǒng)以 AT89C52為核心,主要進(jìn)行基于AT89C52低功耗MCU的字符型數(shù)字鐘及其系統(tǒng)的研究。系統(tǒng)帶有液晶顯示器,配合按鍵提供友好的用戶界面,操作簡(jiǎn)單,同時(shí)具有溫度檢測(cè)功能,時(shí)鐘數(shù)據(jù)和溫度數(shù)據(jù)也可通過(guò)RS232向上位機(jī)傳送。該數(shù)字鐘能長(zhǎng)期、連續(xù)、可靠、穩(wěn)定的工作;同時(shí)還具有體積小、功耗低等特點(diǎn),便于攜帶,使用方便。系統(tǒng)軟件設(shè)計(jì)包括單片機(jī)計(jì)算機(jī)兩部分的編程。計(jì)算機(jī)軟件編程主要實(shí)現(xiàn)參數(shù)設(shè)置、串行口數(shù)據(jù)接收、指令發(fā)送以及數(shù)據(jù)的顯示和存儲(chǔ),采用Visual Basic語(yǔ)言編程。單片機(jī)軟件編程主要實(shí)現(xiàn)鍵盤、液晶顯示、溫度檢測(cè)等各模塊的功能,采用C語(yǔ)言編程。該系統(tǒng)通過(guò)串行口與計(jì)算機(jī)通信,計(jì)算機(jī)給單片機(jī)發(fā)指令實(shí)現(xiàn)數(shù)據(jù)采集及系統(tǒng)控制,并將數(shù)據(jù)實(shí)時(shí)地傳回計(jì)算機(jī)。
關(guān)鍵詞:數(shù)字鐘、液晶顯示、溫度檢測(cè)、串口通信
ABSTRACT
This paper describes the design of a multi-functiond digital clock system.It as displaying and setting time for clock and alarm,this system has other special features such as temperature measurement and data protection at power faillure.The core part of the system is based on a king of advanced MCU,AT89C52,this system mainly carries on low power consume MCU the character list type the research of the digital clock and its system according to the AT89 C52.The system takes liquid crystal display, matching with a key to provide amity of customer interface, the operation is simple, having the temperature examination function in the meantime, the clock data and  the temperature data can also heading up a machine transmission through aRS232. consecution,credibility,stable work;Still have a physical volume in the meantime small,the power consume a low etc. characteristics, easy to take, the usage convenience.The system software design includes a single slice a plait distance with two parts of machine calculator.The calculator software plait distance mainly carries out a parameter constitution,string to go a people's data to receive,the instruction send out and data of manifestation with saving, the adoption Visual Basic languageplaitdistance.Singlelicethemachinesoftwareplaitdistance,LCDmanifestation,temperature examination each mold of etc. piece, adoption the C language plait distance.
That system goes and calculator correspondence through a string, the calculator give single slice machine hair the instruction carry out a data to collect and the system control, and is solid the data the ground send back a calculator.
 
 
Key words:digital clock,LCD,Alarm,Temperture displaying
1.    1數(shù)字鐘的研究的背景及意義
數(shù)字鐘是采用數(shù)字電路實(shí)現(xiàn)對(duì).時(shí),分,秒.數(shù)字顯示的計(jì)時(shí)裝置,廣泛用于個(gè)人家庭,車站, 碼頭辦公室等公共場(chǎng)所,成為人們?nèi)粘I钪胁豢缮俚谋匦杵?由于數(shù)字集成電路的發(fā)展和石英晶體振蕩器的廣泛應(yīng)用,使得數(shù)字鐘的精度,遠(yuǎn)遠(yuǎn)超過(guò)老式鐘表, 鐘表的數(shù)字化給人們生產(chǎn)生活帶來(lái)了極大的方便,而且大大地?cái)U(kuò)展了鐘表原先的報(bào)時(shí)功能。諸如定時(shí)自動(dòng)報(bào)警、按時(shí)自動(dòng)打鈴、時(shí)間程序自動(dòng)控制、定時(shí)廣播、自動(dòng)起閉路燈、定時(shí)開關(guān)烘箱、通斷動(dòng)力設(shè)備、甚至各種定時(shí)電氣的自動(dòng)啟用等,所有這些,都是以鐘表數(shù)字化為基礎(chǔ)的。因此,研究數(shù)字鐘及擴(kuò)大其應(yīng)用,有著非,F(xiàn)實(shí)的意義。
  本作品采用Atmel公司的AT89C51單片機(jī),以匯編語(yǔ)言為程序設(shè)計(jì)的基礎(chǔ),設(shè)計(jì)一個(gè)用四位數(shù)碼管顯示時(shí)、分的時(shí)鐘。在實(shí)物圖中,左邊靠近電源的綠色發(fā)光二極管(長(zhǎng)亮)是電源指示燈,表示的是5V穩(wěn)定電源工作正常;單片機(jī)左下角紅色發(fā)光二極管是秒燈,每閃爍一次表示時(shí)間走動(dòng)一秒鐘;按鍵正上方綠色發(fā)光二極管是設(shè)置燈,當(dāng)時(shí)間正常走動(dòng)時(shí)此時(shí)不亮,當(dāng)?shù)谝淮伟聪略O(shè)置鍵(右鍵)時(shí),此綠燈亮,同時(shí)秒時(shí)熄滅,且分鐘的兩位數(shù)碼管出現(xiàn)閃爍,時(shí)間停止走動(dòng),進(jìn)入校時(shí)狀態(tài),表示此時(shí)可以進(jìn)行分鐘的調(diào)整,當(dāng)按一次加一鍵(左鍵)可實(shí)現(xiàn)分鐘的加一功能,分鐘以60分為極限,超出60分則返回?cái)?shù)值0,從0再重新算起;如果再次按下設(shè)置鍵時(shí),這時(shí)秒燈和設(shè)置燈仍舊保持熄滅和點(diǎn)亮狀態(tài),表示分鐘的數(shù)碼管停止閃爍,反過(guò)來(lái)表示小時(shí)的兩位數(shù)碼管則開始閃爍,此時(shí)可進(jìn)行小時(shí)的調(diào)整,按加1鍵可實(shí)現(xiàn)小時(shí)的加1功能,小時(shí)調(diào)整以24為上限,同樣超出24小時(shí)則從新回0;當(dāng)?shù)谌伟聪略O(shè)置鍵時(shí),數(shù)碼管停止閃爍,設(shè)置燈熄滅,秒燈重新閃爍,時(shí)間以設(shè)定值計(jì)時(shí)。

 

關(guān)閉窗口

相關(guān)文章