看我的定时中断编的程序,可以定为1s的亮时间
org 0000h
ljmp main
org 0033h
ljmp intt0
main: mov tmod ,#01h
mov th0,# 3c h
mov tl0,# b0 h
mov r2,#00h
setb ea
setb et0
setb tr0
sjmp$
intt0: mov th0,# 3c h
mov tl0,# b0 h
inc r2
cjne r2,#0ah,tab1
setb p1.7
cpl p1.0
tab1: cjne r2,#14h,tab2
cpl p1.1
cpl p1.0
tab2: cjne r2,#1eh,tab3
cpl p1.2
cpl p1.1
tab3: cjne r2,#28h,tab4
cpl p1.3
cpl p1.2
tab4: cjne r2,#32h,tab5
cpl p1.4
cpl p1.3
tab5: cjne r2,#3ch,tab6
cpl p1.5
cpl p1.4
tab6: cjne r2,#46h,tab7
cpl p1.6
cpl p1.5
tab7: cjne r2, #50h,next
cpl p1.7
cpl p1.6
mov r2,#00h
next :reti
end
|
|
2013-5-18 00:16:53
评论
举报
|
|
|