单片机综合花样流水灯.docx
- 文档编号:3830919
- 上传时间:2022-11-25
- 格式:DOCX
- 页数:23
- 大小:15.95KB
单片机综合花样流水灯.docx
《单片机综合花样流水灯.docx》由会员分享,可在线阅读,更多相关《单片机综合花样流水灯.docx(23页珍藏版)》请在冰豆网上搜索。
单片机综合花样流水灯
;//时间:
2008.3.5-----------------------//
;//作者:
---------------------------//
;//功能:
全口对撞流水花样-------------------//
ORG0000H
LJMPMAIN
ORG0100H
MAIN:
;--------闪烁-----------------------------
MOVR3,#8
BS0:
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
LCALLDELAY4
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
LCALLDELAY4
DJNZR3,BS0
MOVR3,#8
BS10:
MOVP0,#0AAH
MOVP1,#0AAH
MOVP2,#0AAH
MOVP3,#0AAH
LCALLDELAY4
MOVP0,#55H
MOVP1,#55H
MOVP2,#55H
MOVP3,#55H
LCALLDELAY4
DJNZR3,BS10
;-----------------------------------
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
;---流水部分1------------------------------------------------
MOVR3,#3
LS:
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
MOVR2,#9
MOVA,#00H
KK:
SETBC
MOVP3,A
RLCA
LCALLDELAY
DJNZR2,KK
MOVA,#00H
MOVR2,#9
KK1:
SETBC
MOVP2,A
RRCA
LCALLDELAY
DJNZR2,KK1
MOVA,#00H
MOVR2,#9
KK2:
SETBC
MOVP1,A
RLCA
LCALLDELAY
DJNZR2,KK2
MOVA,#00H
MOVR2,#9
KK3:
SETBC
MOVP0,A
RLCA
LCALLDELAY
DJNZR2,KK3
DJNZR3,LS
;---流水部分2------------------------------------------------
MOVR3,#3
LS2:
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
MOVA,#00H
MOVR2,#9
KK32:
SETBC
MOVP0,A
RRCA
LCALLDELAY
DJNZR2,KK32
MOVA,#00H
MOVR2,#9
KK22:
SETBC
MOVP1,A
RRCA
LCALLDELAY
DJNZR2,KK22
MOVA,#00H
MOVR2,#9
KK12:
SETBC
MOVP2,A
RLCA
LCALLDELAY
DJNZR2,KK12
MOVR2,#9
MOVA,#00H
KK222:
SETBC
MOVP3,A
RRCA
LCALLDELAY
DJNZR2,KK222
DJNZR3,LS2
;---流水部分3------------------------------------------------
MOVR3,#3
LS3:
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
MOVA,#00H
MOVR2,#9
KKI:
SETBC
MOVP3,A
RLCA
LCALLDELAY
DJNZR2,KKI
MOVA,#00H
MOVR2,#9
KKI1:
SETBC
MOVP2,A
RRCA
LCALLDELAY
DJNZR2,KKI1
MOVA,#00H
MOVR2,#9
KKI2:
SETBC
MOVP1,A
RLCA
LCALLDELAY
DJNZR2,KKI2
MOVA,#00H
MOVR2,#9
KKI3:
SETBC
MOVP0,A
RLCA
LCALLDELAY
DJNZR2,KKI3
MOVA,#0FFH
MOVR2,#9
IK3:
CLRC
MOVP3,A
RLCA
LCALLDELAY
DJNZR2,IK3
MOVA,#0FFH
MOVR2,#9
IK2:
CLRC
MOVP2,A
RRCA
LCALLDELAY
DJNZR2,IK2
MOVA,#0FFH
MOVR2,#9
KI1:
CLRC
MOVP1,A
RLCA
LCALLDELAY
DJNZR2,KI1
MOVA,#0FFH
MOVR2,#9
KI:
CLRC
MOVP0,A
RLCA
LCALLDELAY
DJNZR2,KI
DJNZR3,LS3
;--跑马灯----------------------------------------------
MOVR3,#3;跑马灯循环次数
PM1:
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
MOVA,#00H
MOVR2,#9
SETBC
KKP:
MOVP3,A
RLCA
LCALLDELAY
DJNZR2,KKP
MOVP3,#00H
MOVA,#00H
MOVR2,#9
SETBC
KK1P:
MOVP2,A
RRCA
LCALLDELAY
DJNZR2,KK1P
MOVP2,#00H
MOVA,#00H
MOVR2,#9
SETBC
KK2P:
MOVP1,A
RLCA
LCALLDELAY
DJNZR2,KK2P
MOVP1,#00H
MOVA,#00H
MOVR2,#9
SETBC
KK3P:
MOVP0,A
RLCA
LCALLDELAY
DJNZR2,KK3P
MOVP0,#00H
DJNZR3,PM1
;------双向对顶跑马灯---------------------------------------------
MOVR3,#10;双跑马灯循环次数
SPM:
MOV50H,#20
A0:
MOVR4,50H
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
MOV30H,#80H
MOV31H,#01H
MOVR2,#8
B0:
MOVA,30H
MOVP0,A
RRA
MOV30H,A
MOVA,31H
MOVP3,A
RLA
MOV31H,A
LCALLDELAY
DJNZR2,B0
MOVP0,#00H
MOVP3,#00H
MOVA,#80H
MOVR2,#8
B1:
MOVP1,A
MOVP2,A
RRA
LCALLDELAY
DJNZR2,B1
MOVP1,#00H
MOVP2,#00H
DEC50H
DEC50H
DJNZR3,SPM
;---------变速走马---------------------
MOVR2,#5
BPM:
MOV30H,#100
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
MOVA,#80H
MOVR3,#8
B0B:
MOVP0,A
LCALLDELAY3
RRA
DEC30H
DEC30H
DEC30H
DJNZR3,B0B
MOVP0,#00H
MOVA,#80H
MOVR3,#8
B1B:
MOVP1,A
LCALLDELAY3
RRA
DEC30H
DEC30H
DEC30H
DJNZR3,B1B
MOVP1,#00H
MOVA,#01H
MOVR3,#8
B2B:
MOVP2,A
LCALLDELAY3
RLA
DEC30H
DEC30H
DEC30H
DJNZR3,B2B
MOVP2,#00H
MOVA,#80H
MOVR3,#8
B3B:
MOVP3,A
LCALLDELAY3
RRA
DEC30H
DEC30H
DEC30H
DJNZR3,B3B
MOVP3,#00H
DJNZR2,BPM
;-------双向对顶跑马灯------------------------------------
MOVR2,#2
SBPM:
MOV50H,#12
MOV40H,#6
SA0:
MOVR4,50H
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
MOV30H,#80H
MOV31H,#01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AY
DJNZR2,dzk3
MOVR2,#9
dzk13:
MOVA,R5
MOVP3,A
SETBC
RRCA
MOVR5,A
MOVA,R4
MOVP0,A
SETBC
RLCA
MOVR4,A
LCALLDELAY
DJNZR2,dzk13
MOVR2,#9
MOVR7,#0FFH
MOVR6,#0FFH
MOVR5,#0FFH
MOVR4,#0FFH
dz13:
MOVA,R5
MOVP1,A
CLRC
RLCA
MOVR5,A
MOVA,R4
MOVP2,A
CLRC
RLCA
MOVR4,A
LCALLDELAY
DJNZR2,dz13
MOVR2,#9
dz3:
MOVA,R7
MOVP0,A
CLRC
RLCA
MOVR7,A
MOVA,R6
MOVP3,A
CLRC
RRCA
MOVR6,A
LCALLDELAY
DJNZR2,dz3
DJNZR3,DZLS3
;'------------------------------------
MOVR3,#50
BS:
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
LCALLDEL
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
LCALLDEL
DJNZR3,BS
LJMPMAIN
DELAY4:
MOVR0,#200
LL14:
MOVR1,#200
DJNZR1,$
DJNZR0,LL14
RET
DELAY:
MOVR0,#100
LL1:
MOVR1,#100
DJNZR1,$
DJNZR0,LL1
RET
DELAY1:
MOVR0,#100
LL:
MOVR1,#100
DJNZR1,$
DJNZR0,LL
RET
DEL:
MOVA,R4
DECA
DECA
MOVR4,A
MOVR3,A
LLZ:
MOVR1,#170
L:
MOVR2,#1
DJNZR2,$
DJNZR1,L
DJNZR3,LLZ
RET
DELAY2:
MOVR4,50H
D1:
MOVR5,#50
D2:
MOVR6,#100
DJNZR6,$
DJNZR5,D2
DJNZR4,D1
RET
DELAY3:
MOVR4,#3
D13:
MOVR5,30H
D23:
MOVR6,#255
DJNZR6,$
DJNZR5,D23
DJNZR4,D13
RET
END
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 单片机 综合 花样 流水
![提示](https://static.bdocx.com/images/bang_tan.gif)