基于单片机的数字电子钟的设计与制作

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.,2006(,723000):12MHZAT89C51,24,,,:S1,S2S3,:;51;AT89C51;:(1979-),,,,:TP271:A:1006-2165(2006)05-0048-06:2006-07-15,,,,,,,,,,AT89C51,CMOS84KBFlash,,AT89C518051,128BRAM32I/O21651AT89C51,P06LED,P0,,LEDLED,,6LED6LED,,,6LED8I/O,6LEDP2.0P2.5,,8I/O,P0S1,S2S3,,P1.2,P1.4,P1.6P1.72,,20,,,,20,,,,(),,,,,20,20,,20,,,,,,,,,84©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.,,11.32,4:S1,S2S3S1,,,S2S3,,200.1,0.00010.000001,8,,8,,,,2.94©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.:ORG0AJMPMAINORG000BHAJMPTIMETIME:CLRTR0MOVTH0,#3CHMOVTL0,#0B8HSETBTR0MOV09H,R0INC16HMOVR0,16HMOVA,@R0CLRCCJNEA,21H,TMMINC16HMOVR0,16HINC16HMOVA,@R0CLRCCJNEA,22H,TTMMOV19H,#45H;19HAJMPTTMTMM:INC16HINC16HTTM:MOVR0,09HDJNZ18H,OUT0MOV18H,#20MOV16H,#23HMOVA,R2;CLRCSUBBA,#5JZTMMOVA,1BHCPLAMOV1BH,AANLA,R4MOV1AH,ATM:MOVA,17HCLRCSUBBA,#23HJZOUT0SEC:INC20HMOVA,20HCLRCCJNEA,#60,OUT0MOV20H,#0MIN:INC21HMOV19H,#0;CLRP1.7MOVA,21HCLRCCJNEA,#60,OUT0MOV21H,#0HOUR:INC22HMOVA,22HCLRCCJNEA,#24,OUT0MOV22H,#0OUT0:RETIDISP:MOVR0,#10H;10HMOVR7,#7FHMOVR6,#7TO:MOVA,@R0MOVCA,@A+DPTRORLA,#80HPUSHACCMOVA,R7RLAMOVR7,AORLA,1AH;1AHMOVP0,#0MOVP2,A;P2POPACCMOVP0,A;P0INCR0DJNZR6,TORETCHAI:MOVA,@R1MOVB,#10DIVABMOV10H,BMOV11H,AINCR1MOVA,@R1MOVB,#10DIVAB05©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.,BMOV13H,AINCR1MOVA,@R1MOVB,#10DIVABMOV14H,BMOV15H,ADECR1DECR1RETTSHI:MOVA,R2;R2CLRCSUBBA,#0F0HJZGO2MOVR2,#0FHMOVA,R4RRARRAMOVR4,ACLRCCJNEA,#00110000B,GOMOVR3,#22HGO:CLRCCJNEA,#00001100B,GO1MOVR3,#21HGO1:CLRCCJNEA,#00000011B,GO3MOVR3,#20HGO3:CLRCCJNEA,#11000000B,GO2MOVA,17HCLRCCJNEA,#23H,GO4CLRTR0MOVTH0,#3CHMOVTL0,#0B8HSETBTR0MOV17H,#0GO4:MOVR2,#0GO2:RETDSHI:MOVA,R2;R2CLRCSUBBA,#0FHJZDSOUT1MOVR2,#0F0HMOVA,R4RLARLAMOVR4,ACLRCCJNEA,#00001100B,DSOUT2INCR1MOVA,R1MOVR3,ADECR1DSOUT2:MOVA,R4CLRCCJNEA,#00110000B,DSOUT3INCR1INCR1MOVA,R1MOVR3,ADECR1DECR1DSOUT3:MOVA,R4CLRCCJNEA,#00000011B,DSOUT4INCR1INCR1INCR1DSOUT4:MOVA,R4CLRCCJNEA,#11000000B,DSOUT1MOVR4,#00000011BMOVR3,#0FHINCR1INCR1INCR1DSOUT1:RETXSHI:MOVA,R2CLRCSUBBA,#5JZXSOUT3MOVA,R3MOVR0,AINC@R0MOVA,R4CLRCCJNEA,#00000011B,XSOUT15©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.,R2;R2CLRCCJNEA,#0FH,XSOUT4MOV@R0,#0MOV17H,#23HXSOUT4:MOVA,R2;R2CLRCCJNEA,#0F0H,XSOUTMOV17H,#0MOVR4,#11000000BMOVR1,#20HMOVR2,#5XSOUT:MOVA,R4CLRCCJNEA,#00110000B,XSOUT2MOVA,@R0CLRCSUBBA,#24JCXSOUT1MOV@R0,#0XSOUT2:MOVA,R4CLRCCJNEA,#00001100B,XSOUT1MOVA,@R0CLRCSUBBA,#60JCXSOUT1MOV@R0,#0AJMPXSOUT1XSOUT3:MOVA,R5CPLAMOVR5,ACPLP1.0;P1.0XSOUT1:RETMAIN:MOV10H,#0MOV11H,#0MOV12H,#0MOV13H,#0MOV14H,#0MOV15H,#0MOV20H,#0MOV21H,#0MOV22H,#0MOV23H,#1MOV26H,#2MOV29H,#3MOV2CH,#4MOV2FH,#5MOV32H,#6MOV35H,#7MOV38H,#8MOV3BH,#9MOV3EH,#10MOV41H,#11MOV44H,#12MOV47H,#13MOV4AH,#14MOV4DH,#15MOV50H,#16MOV53H,#17MOV56H,#18MOV59H,#19MOV5CH,#20MOV16H,#23CLRP1.2CLRP1.4CLRP1.6CLRP1.7MOVSP,#60HMOVDPTR,#TABMOVR1,#20H;R1MOVR4,#11000000BMOVR2,#5;R2,MOVR5,#00111100B;R5MOV1BH,#0MOV18H,#20MOVP0,#0MOVP2,#0MOVIE,#87HSETBIT0SETBIT1MOVIP,#2;T0MOVTMOD,#1;1MOVTH0,#3CHMOVTL0,#0B8HSETBTR0CLREX0CLREX125©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.:ACALLCHAIACALLDISPRING:MOVA,R5CLRCCJNEA,#00111100B,SS0MOVA,19HCLRCCJNEA,#45H,SS0CPLP1.7SS0:JNBP1.6,SS1ACALLDELJNBP1.6,SS1ACALLTSHICLRP1.6SS1:JNBP1.4,SS2ACALLDELJNBP1.4,SS2ACALLXSHICLRP1.4SS2:JNBP1.2,SS3ACALLDELJNBP1.2,SS3ACALLDSHICLRP1.2SS3:AJMPSTARTDEL:DJNZ1DH,DJNZ1CH,DELRETTAB:DB3FH,6H,5BH,4FH,66H,6DH,7DH,7H,7FH,6FHEND[1],,.[M].:,2004.[2],.[M].:,2001.[3].MCS-51/96[M].:,1998.[4].MCS-51[M].:,2001.[5].[M].:,2003.DesignandManufactureofDigitalElectronClockBasedonMCULUChao(DepartmentofPhysics,ShanxiUniversityofTechnology,Hanzhong723000,China)Abstract:ThiselectronclockisconnectedtotheMCUAT89C51bythe12MHZcrystaloscillator.Withsoftwareprogramming,theclockcandisplayhour,minuteandsecondatthesametimeina24-hourcycle.Itcangivecorrecttimewithabuzzerwhenitisonthehour.Thiskindofelectronclockisequippedwiththreekeys,S1,S2andS3,whichenabletheclocktoadjusttokeepaccuratetimeandtobuzzatthesettime.Keywords:electronclock;51seriesMCU;AT89C51;crystaloscillator35

1 / 6
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功