程序如下,开始怀疑是时钟快了用了4mhz的还不行,延时没有改,有点乱
pll_d bit p2.6
pll_clk bit p2.5
pll_enb bit p2.7
;===================================
org 0000h
jmp start
org 0080h
start:
clr p2.2
clr pll_enb
clr pll_d
clr pll_clk
mov r2,#0ah
rx:
clr pll_clk
clr pll_d
lcall delay
lcall delay
lcall delay
lcall delay
rx1:
mov a,#64h
mov r3,#08h
lcall updata
mov a,#6bh
mov r3,#08h
lcall updata
mov r3,#01h
mov a,#00h
clr p2.1
lcall updata
call delay
clr pll_clk
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
lcall delay
setb pll_enb
lcall delay
lcall delay
lcall delay
lcall delay
clr pll_enb
lcall delay
lcall delay
clr p2.3
lcall delay
lcall delay
lcall delay
cpl p2.3
djnz r2,rx1
clr p2.0
jmp $
updata:
clr c
up_1:
rlc a
mov pll_d,c
lcall delay
clr pll_clk
lcall delay
lcall delay
lcall delay
lcall delay
setb pll_clk
lcall delay
lcall delay
;clr pll_clk
lcall delay1
djnz r3,up_1
ret
delay:
mov r1,#20h
djnz r1,$
ret
delay1:
mov r1,#10h
djnz r1,$
ret
end