單片機設置和中斷程序及仿真
1)特殊功能寄存器

2)存儲器

2 定時與中斷
1)定時與計數(shù)設置

2)中斷設置

單片機中斷程序,T1中斷
ORG 0000h
Ljmp main
clr a
mov r7,#00h
ORG 0013h
main: setb EA
setb ET1
setb PT1
mov TMOD,#0e0h
setb TR1
mov p0,TL1
jnb p1.7,DD1
sjmp ddd
DD1: MOV R5,#00H
DD2: mov r4,#80h
DJNZ R4,$
djnz r5,dd2
JNB P1.7,jjj
sjmp ddd
jjj:mov r3,#00h
djnz r3,$
inc r7
add a,#01h
da a
mov p0,a
mov p2,a
inc r7
cjne r7,#99D,ddd
ddd:nop
end
仿真電路

評論