用T0定时 从p1.0口输出周期为一秒 宽度为2ms的脉冲!
帮我看看错在那,怎运行不出来呀!
org 0000h
ljmp main
main:
org 0100h
mov tmod ,#01h
clr P1.0
loop:
mov th0 ,#0ffh
mov tl0 ,#0ffh
setb tr0
jnb tf0 ,$
clr tf0
clr tr0
mov th0 ,#003dh
mov tl0 ,#0e0h
setb tr0
jnb tf0 ,$
cpl P1.0
clr tr0
clr tf0
mov th0 ,#0b1h
mov tl0 ,#0e0h
setb tr0
jnb tf0 ,$
cpl P1.0
clr tr0
clr tf0
sjmp loop
end