MOV A,P4M1 ;M1=0
ANL A,#10011111B ;P4.6推挽输出
MOV P4M1,A
MOV A,P4M0 ;M0=1
ORL A,#01100000B ;P4.5推挽输出
MOV P4M0,A
MOV A,P0M1
ANL A,#11111100B ;P0.0推挽输出
MOV P0M1,A
MOV A,P0M0
ORL A,#00000011B ;P0.1推挽输出
MOV P0M0,A
CLR A
MOV P2M1,A
CPL A
MOV P2M0,A
mov a,50h ;50h显示指针
DEC A ;60h显示缓存区
MOV 50H,A
JZ DE3 ;1
DEC A
JZ DE2 ;2
DEC A
JZ DE1 ;3
DEC A
JZ DE4 ;4
DEC A
JZ DE3 ;5
DEC A
JZ DE2 ;6
DEC A
JZ DE1 ;7
dec a
JZ DE4 ;8
DEC A
JZ DE3 ;9
DEC A
JZ DE2 ;10
DEC A
JZ DE1 ;11
DEC A
JZ DE4 ;12
DEC A
JZ DE3 ;13
DEC A
JZ DE2 ;14
DEC A
JZ DE1 ;15
DE0: ;16
MOV A,#0FH
MOV 50H,A ;50h显示位置指针
MOV 51H,#60H ;显示缓冲器地址指针
; MOV R1,51H
; MOV A,@R1
; mov P2,A ;显示数据送P2
; SETB P4.5
; CLR P0.1
; jmp ASD
de4: ;
MOV R1,51H
MOV A,@R1
mov P2,A ;显示数据送P2
INC 51H
setb P4.5
clr p4.6 ;wei=1
jmp asd
nop
nop
nop
mov IAP_CONTR,#01100000b ;ap区软复位
de3: ;2
MOV R1,51H
MOV A,@R1
mov P2,A ;显示数据送P2
INC 51H
setb P4.6
clr P0.0
jmp asd
de2: ;1
MOV R1,51H
MOV A,@R1
mov P2,A ;显示数据送P2
INC 51H
setb P0.0
clr P0.1
jmp asd
de1:
MOV R1,51H
MOV A,@R1
mov P2,A ;显示数据送P2
INC 51H
setb P0.1
clr P4.5
jmp asd
asd:
ret
如上设置,P4.5 P4.6,可以在T0中断控制下输出脉冲,P0.0 P0.1却不能输出脉冲,请高手指点, |