资源描述:
《LED心形灯.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、LED0 EQUP1 LED2 EQUP2 LED1 EQUP0 MARK BIT00H MARK1BIT01H TIME EQU30H;时间缓冲区 SHI EQU31H;时长数据缓冲区! KEY EQUP3.2 KEY1 EQUP3.3 CTHEQU(65536-50000)/256 CTLEQU(65536-50000)MOD256 ORG0000H JMPSTART ORG0003H JMPINT_0 ORG000BH JMPTIME0 ORG0030HSTART: MOVP1,#00H MOVP0,#0FFH MOVP2,#0FFH MOVDP
2、TR,#ABC MOVSP,#5FH MOVSHI,#20 MOVR0,SHI MOVR7,#20 CLRMARK CLRMARK1 MOVTMOD,#01H MOVTH0,#CTH;初始指针 MOVTL0,#CTL SETBEA SETBIT0 SETBEX0 SETBET0 SETBTR0 MOVTIME,R0 CALLDISPLAYMAIN:MOVLED0,#21H;北,红灯亮 CJNER0,#3,MAIN MOVSHI,#04NEXT: MOVR6,#3A1: MOV LED0,#01H CALLDELAY_500MS MOVL
3、ED0,#21H CALLDELAY_500MS DJNZR6,A1S1:JBCMARK,A2 SJMPS1 A2:MOVLED0,#11H;BEIHUANGDENGLIANG MOVSHI,#20 JBCMARK,MAIN1 SJMPA2MAIN1: MOVLED0,#0CH;XIHONGDENGLIANG CJNER0,#3,MAIN1 MOVSHI,#04NEXT1: MOVR6,#3A3: MOVLED0,#08H CALLDELAY_500MS MOVLED0,#0CH CALLDELAY_500MS DJNZR6,A3S2:JBCMARK,A4
4、SJMPS2A4:MOVLED0,#0AH MOVSHI,#20 JBCMARK,MAIN SJMPA4DELAY_500MS: MOVR5,#20K1:MOVR4,#50K2:MOVR3,#250 DJNZR3,$ DJNZR4,K2 DJNZR5,K1 RETDISPLAY:MOVA,TIME MOVB,#10 DIVAB MOVCA,@A+DPTR MOVLED2,A MOVA,B MOVCA,@A+DPTR MOVLED1,A RETABC: DB0C0H,0F9H,0A4H,0B0H,99H,92H,82
5、H,0F8H,80H,90H INT_0: PUSHACC PUSHPSW SETBRS1 SETBRS0 MOVR5,#70K4:MOVR4,#250 DJNZR4,$ DJNZR5,K4 JBKEY,ITT_2 MOVTIME,#20 CALLDISPLAYITT_1: MOVLED0,#00010010B CALLDELAY_500MS MOVLED0,#00H JNBKEY,ITT_2 CALLDELAY_500MS JBKEY,ITT_1ITT_2: JNBKEY,$ POPPSW POPACC RETI TIME0:P
6、USHACC PUSHPSW MOVTH0,#CTH;初始指针 MOVTL0,#CTL DJNZR7,TIME1 MOVR7,#20 DJNZR0,TIME2 SETBMARK MOVR0,SHITIME2:MOVTIME,R0 CALLDISPLAYTIME1:POPPSW POPACC RETI END