开关控制二极管亮灭+数码管.docx
- 文档编号:26791202
- 上传时间:2023-06-22
- 格式:DOCX
- 页数:28
- 大小:444.95KB
开关控制二极管亮灭+数码管.docx
《开关控制二极管亮灭+数码管.docx》由会员分享,可在线阅读,更多相关《开关控制二极管亮灭+数码管.docx(28页珍藏版)》请在冰豆网上搜索。
开关控制二极管亮灭+数码管
开关控制二极管亮灭
+5V
P1.5=1P2.1=1
P1.5=0P2.1=0
START:
JBP1.5,LOOP
;判断开关疋断开还疋闭合,条件疋:
P1・5疋不疋
等于1
CLRP2.1
;闭合
LJMPSTART
LOOP:
SETBP2.1
;断开
LJMPSTART
START:
JBP1.5,LOOP
;判断开关疋断开还疋闭合,条件疋:
P1・5疋不疋
等于1
CLR
P2.1;
闭合
SETB
P2.2
LJMP
START
LOOP:
SETB
P2.1
CLR
P2.2
LJMP
START
END
Pl.5
T
END
Fl.5
Pl.6
VD
F2.1
P2.2
VD
P2.2^1灭P2,2^0亮
P2.2=0亮P2.2=1灭
START:
JBP1.5,LOOPCLRP2.1
JBP1.6丄OOP1CLRP2.2LJMPSTARTLOOP:
SETBP2.1JBP1.6丄OOP1
CLRP2.2
LJMPSTARTLOOP1:
SETBP2.2LJMPSTARTEND
A
Start:
Jbpl.5,dianqi
Clrp2.1
Loopl:
Djnzr0,loop1
Djnzr1,loop1
Setbp2・1
Loop2:
Djnzr0,loop2
Djnzr1,loop2
Ljmpstart
Dianqi:
Setbp2.1
Ljmpstart
end
课题15
1.300Q
2•标注端口
题库3
START:
JNBP0.0,BAOJINGJBP0.1,BAOJINGSETBP1.0
SETBP1.1
clrP2.0
LJMPSTART
BAOJING:
SETBP1.0
CLRP1.1
ClrP2.0
LOOP:
DJNZR0,LOOP
DJNZR1,LOOP
CLRP1.0
SETBP1.1
SETBP2.0
LOOP1:
DJNZR0,LOOP1
DJNZR1,LOOP1
LJMPstart
END
条件成立,跳转到biaojue,二极管不亮,P2.1=1
条件不成立,不跳转,继续判断第二个开关
条件成立,跳转biaojue,二极管不亮,P2.1=1
条件不成立,不跳转,二极管亮P2.1=0
裁判表决器
Jb
p1.5.
biaojue
开关断开
P1.5=1,
C5开关闭合
P1.5=0,
Jb
p1.6.
biaojue
;CD开关断开
P1.6=1,
C5开关闭合
P1.5=0,
Start:
clrp2.1Ljmpstart
Biaojue:
Setbp2.1LjmpstartEnd
start:
hlovcjpl.5orlcjpl-6jncbiaojuesetbp2・1ljinpstartbiaojue:
clrp2,1ljm.pstartend
课题4
START:
JBP1.5,CHENG
JBP1.6,ZHANG
CLRP2.1
MovR7,#10
LOOP?
CLRP22
DAT
DJNZR0,DAL
DJNZR1,DAL
SETBP21
DAL1「
DJNZR0,DAL1
pJNZR1,DAL1
DJNZR7,LOOP
LJMPDONE
CHENG:
SETBP2.1
CLRP2.2
DAL2「
DJNZR0,DAL2
DJNZR1,DAL2
SETBP22
DAL3「
DJNZR0,DAL3
DJNZR1,DAL3
LJMPSTART
ZHANG:
JBP1.7,GAO
CLRP2.1;P2.1是灯
MOV~R7,#1q
|LOOP1:
CLRP2.2
DAL4:
DJNZR0,DAL4
DJNZR1,DAL4
SETBP2.2
DAL5:
DJNZR0,DAL5
DJNZR1,DAL5
DJNZR7,LOOP1
LJMPDONE
GAO:
SETBP2.1
CLRp21
DAL5:
DJNZR0,DAL5
DJNZR1,DAL5
SETBP22
DAL6:
DJNZR0,DAL6
DJNZR1,DAL6
LJMPSTART
DONE:
END
数码管
共阴数码管
3FH,06H,5BH
4FH,66H,6DH
7DH,07H,7FH
6FH,77HI,7CH
58H,5EH,7BH
71H,OOH,40H
;0,1,2
;3,4,6
;6,7,&仪
;9,2
;C,D£
;F,,-p
任务1:
显示dq3112
1±J
—
丄
—
4_
-.
■f甘一U1
MovP1,#06H;1字模
MOVP2,#01H
END
mm
课题14
1.
2.
3.
4.
U1
tF
计数器
F'O.CMADOP0,1JM1P0.2MI3F0.銅3PD41ADJP0.5j(AD5PO.&MJ0PD.7J(AD7
PS.OMB
P2.1fA5P2.M10P2.3^11P2.4fA12P2.5fA13PM虞MP27fA1弓
PJWRXDP3.1JTTXD!
P3.2jiNT0~P33riNTTps.irroP3.5TT1
P3.7iRD
DIANQI:
MOVr7,#0
MOVDPTR,#YINJUN
Start:
JNBP0.4,LOOP
LJMPSTART
LOOP:
DAL:
DJNZR0,DAL
DJNZR1,DAL
MovA,R7
MOVCA,@A+DPTR
INCR7
MOVP1,A
MovP2,#01H
CJNER7,#10H,START
LJMPDIANQI
YINJUN:
DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH,
END
课题8
>XTAL1
XTAL2
RST
PSENALEEA
TE)CI
U1
□1234567PIP1P1P1PIP1P1P1
POO/AC&OPO.1/AD1PO.2/AD2
FO3/AD3
PD.4/AIMPO5/AD5PO.®/AD6PO.7/AD7
P2.O/A3
P2.1/A9P2.27A10P2.3/A11P2.4/A12P2.5/A13P2.S/AUP37/A15
P3.0/RXDP31/TXDP324NTOPS-SunNTI
P34/IID
P35?
T1
P3.6/WR
P37/RID
ASCDETFGOR1a
□e
—zg.
2A
12
—Li
1A
MOVr6,#0
MOVDPTR,#YINJUN
DIANQI:
MOVr7,#0
Start:
JNBP0.4,TIAOYONG
MOVP1,R5
MovP2,#01H
DAL1:
DJNZR0,DAL1
MOVP1,R4
MovP2,#02H
LJMPSTART
TIAOYONG:
DAL:
DJNZR0,DAL
DJNZR1,DAL
MovA,R7;个位显示
MOVCA,@A+DPTR
MOVR5,AINCR7CJNER7,#10,STARTINCR6
MovA,R6;十位显示
MOVCA,@A+DPTR
MOVR4,A
LJMPQIANQI
YINJUN:
DB3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
END
抢答器
□1
XT^L2
X
才
4-
pg£NALE丽
F1J0
Pl.1
Pl3
PiJ
PI.4
Pl.5
P1J
PI7
BOC5I
POtWiDOPOllMDllP07W7PD3WD3PO4JAD4
FO&frD6F0TWD7
P2QMSF2.1iAgP2.2JA10P2.MjP74JS.11;P2.5JM3阿.创AUP27JA15
F3.WRXDP3.1JWR3imTiTP33mrT
P3.4JTO
P3.5fT1_F3Wffi"Pa.TfRD
vuT-乩-■---■■-■-
「I1_|■-JJ*r*
111111-—1
START:
JNBP0.0,LIANGYI
JNBP0・1,LIANGER
LJMPSTART
LIANGYI:
MOVP1,#06H
MOVP2,#01H
LJMPDONE
LIANGER:
MOVP1,#5BH
MOVP2,#01H
DONE:
END
课题2
课题11
org0000hljmpmainorg0003hljmpintorg0100hmain:
mova,#03hmovr0,#4setbeasetbex0setbit0here:
sjmphereint:
djnzr0,dianliangsjmpdonedianliang:
movp1,arrcasjmpoverdone:
movp1,#0ffhmova,#03hmovr0,#4over:
retiend
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 开关 控制 二极管 数码管