$include (c8051f330.inc)
n1 equ 30h
n2 equ 31h
n3 equ 32h
rr1 equ 33h
rr2 equ 34h
rr3 equ 35h
org 0000h
ljmp 100h
org 000bh
ljmp intclk0
org 0100h
mov P0MDOUT, #0ffh
mov XBR0, #001h
mov XBR1, #040h
mov TMOD, #022h
mov IE, #00Ah
mov r0,#00h
mov r1,#00h
mov tl0,#0ffh
mov th0,#0ffh
setb ea
setb et0
setb tr0
MOV P0,#00H
here:mov n1,#23h
mov n2,#0f3h
mov n3,#058h
mov rr1,#11h
mov rr2,#0a5h
mov rr3,#085h
sjmp here
intclk0:inc r0
cjne r0,#1,next1
mov r1,n1
sjmp yw1
next1: cjne r0,#9,next2
mov r1,n2
sjmp yw1
next2: cjne r0,#17,next3
mov r1,n3
sjmp yw1
next3: cjne r0,#25,next4
mov r1,rr1
sjmp yw1
next4: cjne r0,#33,next5
mov r1,rr2
sjmp yw1
next5: cjne r0,#41,next6
mov r1,rr3
sjmp yw1
next6: cjne r0,#48,next7
mov r0,#0h
sjmp yw1
next7: cjne r0,#20,next8
sjmp yw2
next8: cjne r0,#40,yw1
sjmp yw2
yw1: mov a,r1
RLC a
mov r1,a
MOV P0.0,C
CALL DELAYUS
setb P0.3
CALL DELAYUS
clr p0.3
RETI
yw2: mov a,r1
RLC a
mov r1,a
MOV P0.0,C
CALL DELAYUS
setb p0.3
CALL DELAYUS
clr p0.3
SETB P0.2
call delayus
clr p0.2
RETI
DELAYUS:NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
RET
END
这里写了两次20位的数据,要求的时序见附件中图
P0.0 是DATA
P0.2 是EL
P0.3是CLK
那位帮忙看看啊!!!
圈到的不知道怎么出来的