電子鐘專周報告_第1頁
電子鐘專周報告_第2頁
電子鐘專周報告_第3頁
電子鐘專周報告_第4頁
電子鐘專周報告_第5頁
已閱讀5頁,還剩26頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

04導(dǎo)老成時2012-5-一.8051LEDLCD液晶模塊,進(jìn)行時間顯示,格式為“時:分:秒”;整點二.LCD液晶模塊,進(jìn)行時間顯示,格式為“針對要實現(xiàn)的功能,采用AT89S51單片機(jī)進(jìn)行設(shè)計,AT89S51單片機(jī)是一款低功耗,序存儲器,器件采用高密度、非易失性存儲技術(shù)制造,兼容標(biāo)準(zhǔn)MCS-51指令系統(tǒng)及80C51開始/時鐘/1919開始時鐘本電路的輸出信號為7

P開始時鐘本實驗用匯編程序完成開始、繼LED1秒改變一次明暗,此4142434556;12M晶振20100114調(diào)試完 0315修 20110303注STRTEQUP2.6STPEQUP2.7CLRREQUP3.0SECEQUP3.5MINEQUP3.6HOUREQUP3.7ORG00HSJMPMAINORG0BHAJMPT0INT0ORG30HMAIN:MOV MOVR4,#20MOVMOVTH0,#03CH ;#9EH12M晶振時定時初值取#3CB0HMOVTL0,#0B0H SETBET0SETB;MOVkS:LCALLDISP秒調(diào)整按鍵JBSEC,KMLCALLDISPJNBSEC,$-3AJMPSINCkM:JBMIN,KH分調(diào)整按鍵LCALLDISPJNBMIN,$-3AJMPKH:JBHOUR,K1時調(diào)整按鍵LCALLDISPJNBHOUR,$-3AJMPHINCSINC:INC26H秒調(diào)整MOVA,26HCJNEA,#60,SINC0MOV26H,#0SINC0:AJMPKSMINC:INC27H分調(diào)整MOVA,27HCJNEA,#60,MINC0MOV27H,#0MINC0:AJMPKMHINC:INC28H時調(diào)整MOVA,28HCJNEA,#24,HINC0MOV28H,#0HINC0:AJMPKHk1:LCALLDISP開始鍵JBSTRT,K2LCALLDISPJNBSTRT,$-3AJMPk2:JBSTP,K3暫停鍵LCALLDISPJNBSTP,STOPK3:JBCLRR,KSLCALLDISPJNBCLRR,CLEAR;AJMPSTART:SETBTR0 AJMPK1STOP:CLRTR0暫停AJMPK2CLEAR:CLR TR0清零MOVA,#0MOV26H,A MOV28H,AAJMPKSMOVA,26HMOVB,#10DIVABMOV ;余數(shù)(秒個位數(shù)MOV21H,A MOVA,27HMOVB,#10DIVABMOV ;余數(shù)(分個位數(shù)MOV23H,A MOVA,28HMOVB,#10DIVABMOV ;余數(shù)(時個位數(shù)MOV25H,A MOVA,20H ACALLSEG7MOVP0,ACLRP2.0ACALLDLYSETBP2.0MOV ;ACALLSEG7MOVP0,ACLRP2.1ACALLDLYSETBP2.1MOV ;ACALLSEG7MOVP0,ASETBP0.7CLRP2.2ACALLDLYSETBP2.2MOV ;ACALLSEG7MOVP0,ACLRP2.3ACALLDLYSETBP2.3MOV ;ACALLSEG7MOVP0,ASETBP0.7CLRP2.4ACALLDLYSETBP2.4MOV ;ACALLSEG7MOVP0,ACLRP2.5ACALLDLYSETBP2.5T0INT0:MOVTH0,#03CH;#9EH定時中斷子程序。重裝定時常數(shù)MOVTL0,#0B0H;#58HDJNZR4,T0INTR;50msX20=1S20MOVINC26H MOVA,26HCJNE ;60SMOV26H,#0 INC27H MOVCJNEA,#60,T0INTRMOV27H,#0INC28HMOVA,28HCJNEA,#24,T0INTRMOV28H,#0T0INTR:RETI MOVR3,#30D0:ACALLDLYDJNZR3,D0DLY:MOVR7,#2D1:MOVR6,#40DJNZR6,$DJNZR7,D1SEG7:INCAMOVCA,@A+PC STRTEQUP2.6STPEQUP2.7CLRREQUP3.0SECEQUP3.5MINEQUP3.6HOUREQUP3.7ORG00HAJMPMAINORG0BHAJMPT0INTORG1BHAJMPT1INTORG30H MOVR4,#20MOV 定時初值取#3CB0H,還可細(xì)調(diào)如MOVTL0,#0B0H;#58HMOVTH1,#0FEHMOVTL1,#0CHSETBEASETBET0SETBACALLDISPACALLALARMJBSEC,KM ACALLDISPJNBSEC,$-2AJMPSINCJBMIN,KH ACALLDISPJNBMIN,$-2AJMPJB ;ACALLDISPJNBHOUR,$-2AJMPHINCJB7FH,SINC_AMOVA,26HMOV26H,#0AJMPSINC0INC36H;MOVMOV36H,#0SINC0:AJMPKSJB7FH,MINC_AINC27HMOVCJNEA,#60,MINC0MOV27H,#0INC37H;MOVCJNEA,#60,MINC0MOV37H,#0AJMPJB7FH,HINC_AMOVA,28HCJNEA,#24,HINC0MOV28H,#0INC38H;MOVCJNEA,#24,HINC0MOV38H,#0AJMPJBSTRT,K2ACALLDISPJNBSTRT,$-2AJMPJBSTP,K3暫停鍵ACALLDISPJNBSTP,$-2AJMPCL_ALJBCLRR,KS0ACALLDISPJNBCLRR,CLEAR;AJMPKSCPL ;開始/SETB7DH ;7DH為開始鍵按下標(biāo)志,此作為允許鬧鈴標(biāo)志AJMPK1CPL7FH ;7FH作時鐘和鬧鈴標(biāo)志位AJMPK2 MOVA,#0MOV26H,AMOV27H,AMOV28H,AMOV36H,A MOV38H,AAJMPJBMOV29H,26H MOV2AH,27HAJMPDISP1MOV29H,36HMOV2BH,38HMOVB,#10DIVABMOV ;余數(shù)(秒個位數(shù)MOV21H,A MOVA,2AHMOVB,#10DIVABMOV ;余數(shù)(分個位數(shù)MOV23H,A MOVA,2BHMOVB,#10DIVABMOV ;余數(shù)(時個位數(shù)MOV25H,A MOVA,20H ACALLSEG7MOVP0,ACLRP2.0ACALLDLYSETBP2.0MOV ;ACALLSEG7MOVP0,ACLRP2.1ACALLDLYSETBP2.1MOV ;ACALLSEG7MOVP0,ASETBP0.7CLRP2.2ACALLDLYSETBMOVA,23H ACALLSEG7MOVP0,ACLRP2.3SETBP2.3MOV ;ACALLSEG7MOVP0,ASETBP0.7CLRP2.4ACALLDLYSETBP2.4MOV ;ACALLSEG7MOVP0,ACLRP2.5ACALLDLYSETBP2.5JNB ;MOVA,28H ;開機(jī)時,時分秒都為0,跳出JZAL0MAJMPALARM1JZAL0SAJMPALARM1JZRTMOV ;CJNEA,38H,AL MOVA,27H CJNEA,37H,ALMOVA,26H CJNEA,36H,ALAJMPALARM2 ;MOVJZRT ;0000MOVA,27HJNZRT ;00,跳出MOVA,26HJNZAJMPALARM3;秒不為00,跳出。為00,整點提醒 ;鬧鈴3SSETBTR1AJMPRT ;整點提醒SETBTR1MOVTH0,#03CH;定時中斷子程序。重裝定時常數(shù)MOVTL0,#0B0HDJNZR4,T0INTR ;50msX20=1S20次,跳出中斷子程序MOVR4,#20INC ;1S,秒存儲單元內(nèi)數(shù)INCR0 MOVA,26HCJNEA,#60,T0INTR ;未滿60S,跳出中斷。MOV26H,#0 ;滿60S,秒單元清零INC27H MOVA,27H

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論