基于单片机的数字电子钟设计与制作2pdfWord格式文档下载.docx
- 文档编号:14592906
- 上传时间:2022-10-23
- 格式:DOCX
- 页数:10
- 大小:15.46KB
基于单片机的数字电子钟设计与制作2pdfWord格式文档下载.docx
《基于单片机的数字电子钟设计与制作2pdfWord格式文档下载.docx》由会员分享,可在线阅读,更多相关《基于单片机的数字电子钟设计与制作2pdfWord格式文档下载.docx(10页珍藏版)》请在冰豆网上搜索。
MOV18H,#20
MOV16H,#23H
MOVA,R2;
控制闪烁
SUBBA,#5
JZTM
MOVA,1BH
CPLA
MOV1BH,A
ANLA,R4
MOV1AH,A
TM:
MOVA,17H
SUBBA,#23H
JZOUT0
SEC:
INC20H
MOVA,20H
CJNEA,#60,OUT0
MOV20H,#0
MIN:
INC21H
MOV19H,#0;
一分钟到关闹铃
CLRP1.7
MOVA,21H
CJNEA,#60,OUT0
MOV21H,#0
HOUR:
INC22H
MOVA,22H
CJNEA,#24,OUT0
MOV22H,#0
OUT0:
RETI
DISP:
MOVR0,#10H;
10H作为显存首址
MOVR7,#7FH
MOVR6,#7
TO:
MOVA,@R0
MOVCA,@A+DPTR
ORLA,#80H
PUSHACC
MOVA,R7
RLA
MOVR7,A
ORLA,1AH;
1AH控制闪烁
MOVP0,#0
MOVP2,A;
P2为位选
POPACC
MOVP0,A;
P0作为段选
INCR0
DJNZR6,TO
RET
CHAI:
MOVA,@R1
MOVB,#10
DIVAB
MOV10H,B
MOV11H,A
INCR1
MOVA,@R1
MOV12H,B
MOV13H,A
MOV14H,B
MOV15H,A
DECR1
TSHI:
MOVA,R2;
R2作为调时与定时的标志
SUBBA,#0F0H
JZGO2
MOVR2,#0FH
MOVA,R4
RRA
MOVR4,A
CJNEA,#00110000B,GO
MOVR3,#22H
GO:
CLRC
CJNEA,#00001100B,GO1
MOVR3,#21H
GO1:
CJNEA,#00000011B,GO3
MOVR3,#20H
GO3:
CJNEA,#11000000B,GO2
MOVA,17H
CJNEA,#23H,GO4
CLRTR0
MOVTL0,#0B8H
MOV17H,#0
GO4:
MOVR2,#0
GO2:
RET
DSHI:
SUBBA,#0FH
JZDSOUT1
MOVR2,#0F0H
CJNEA,#00001100B,DSOUT2
MOVA,R1
MOVR3,A
DSOUT2:
MOVA,R4
CJNEA,#00110000B,DSOUT3
DSOUT3:
CJNEA,#00000011B,DSOUT4
INCR1
DSOUT4:
CJNEA,#11000000B,DSOUT1
MOVR4,#00000011B
MOVR3,#0FH
DSOUT1:
XSHI:
MOVA,R2
SUBBA,#5
JZXSOUT3
MOVA,R3
MOVR0,A
INC@R0
CJNEA,#00000011B,XSOUT
CJNEA,#0FH,XSOUT4
MOV@R0,#0
MOV17H,#23H
XSOUT4:
CJNEA,#0F0H,XSOUT
MOV17H,#0
MOVR4,#11000000B
MOVR1,#20H
MOVR2,#5
XSOUT:
CJNEA,#00110000B,XSOUT2
SUBBA,#24
JCXSOUT1
MOV@R0,#0
XSOUT2:
CJNEA,#00001100B,XSOUT1
SUBBA,#60
AJMPXSOUT1
XSOUT3:
MOVA,R5
MOVR5,A
CPLP1.0;
P1.0闹铃开关指示灯
XSOUT1:
MAIN:
MOV10H,#0
MOV11H,#0
MOV12H,#0
MOV13H,#0
MOV14H,#0
MOV15H,#0
MOV20H,#0
MOV21H,#0
MOV22H,#0
MOV23H,#1
MOV26H,#2
MOV29H,#3
MOV2CH,#4
MOV2FH,#5
MOV32H,#6
MOV35H,#7
MOV38H,#8
MOV3BH,#9
MOV3EH,#10
MOV41H,#11
MOV44H,#12
MOV47H,#13
MOV4AH,#14
MOV4DH,#15
MOV50H,#16
MOV53H,#17
MOV56H,#18
MOV59H,#19
MOV5CH,#20
MOV16H,#23
CLRP1.2
CLRP1.4
CLRP1.6
CLRP1.7
MOVSP,#60H
MOVDPTR,#TAB
MOVR1,#20H;
R1作为拆分地址首
MOVR2,#5;
R2作为定时,调时选择
MOVR5,#00111100B;
R5作为闹铃开关
MOV1BH,#0
MOV18H,#20
MOVP0,#0
MOVP2,#0
MOVIE,#87H
SETBIT0
SETBIT1
MOVIP,#2;
设T0优先级最高
MOVTMOD,#1;
定时器模式1
MOVTH0,#3CH
MOVTL0,#0B8H
CLREX0
CLREX1
START:
ACALLCHAI
ACALLDISP
RING:
CJNEA,#00111100B,SS0
MOVA,19H
CJNEA,#45H,SS0
CPLP1.7
SS0:
JNBP1.6,SS1
ACALLDEL
JNBP1.6,SS1
ACALLTSHI
SS1:
JNBP1.4,SS2
JNBP1.4,SS2
ACALLXSHI
SS2:
JNBP1.2,SS3
JNBP1.2,SS3
ACALLDSHI
SS3:
AJMPSTART
DEL:
DJNZ1DH,$
DJNZ1CH,DEL
TAB:
DB3FH,6H,5BH,4FH,66H,6DH,7DH,
7H,7FH,6FH
END
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于 单片机 数字 电子钟 设计 制作 pdf
![提示](https://static.bdocx.com/images/bang_tan.gif)