本人以经肯定电路的硬件连接没有问题了,4个8*8的点阵屏都有点亮,但和造字程序相比的点阵错了,本人可以推断出硬件是左移或右移,当有仿真器调试
A P2口全为1时,P1.0-P1.3的四位0或1可以控制16*16点阵的下半部灯一行一行亮,可以上下或左右移动.
B P2口全为0,P0口全为1时P1.0-P1.3的四位0或1可以控制16*16点阵的上半部灯一行一行亮,可以上下或左右移动.
*****电路图和造字程序都在以下网址**************************
http://bbs.21ic.com/upfiles/img/20078/2007814183127558.jpg
请问我的程序错在哪里!!可以帮帮忙!!教教小弟吗??
ORG 00H
START: MOV A,#00H
MOV P0,A ;清除画面
ANL P2,#00H
MOV R2,#200
D1: MOV R3,#0F8H ;延一秒
DJNZ R3,$
DJNZ R2,D1
MOV 20H,#00H ;取码措针初值
L1: ;MOV R1,#0FFH ;每字停留时间
L2: MOV R6,#16 ;每字16个码
MOV R4,#00H ;扫描初值
MOV R0,20H ;取码指针存入R0
L3: MOV A,R4 ;扫描指针载入A
MOV P1,A ;扫描输出
INC R4 ;扫描下一个
MOV A,R0 ;取码指针载入A
MOV DPTR,#TABLE ;数据指针指到TABLE
MOVC A,@A+DPTR ;至TABLE取上半部数据码
MOV P0,A ;输出至P0显示
INC R0 ;取码指针加1
MOV A,R0 ;取码指针载入A
MOV DPTR,#TABLE ;数据指针指到TABLE
MOVC A,@A+DPTR ;至TABLE取下半部数据码
MOV P2,A ;输出数据码
INC R0 ;取下一个码
MOV R3,#02H ;扫描时间1毫秒
D2: MOV R5,#0F8H
DJNZ R5,$
DJNZ R3,D2
MOV A,#00H ;清除屏幕
MOV P0,A
ANL P2,#00H
DJNZ R6,L3 ;显示1个字了?
DJNZ R1,L2 ;停留时间到了?
MOV 20H,R0 ;取码指针存入 20H地址
CJNE R0,#0FFH,L1 ;8个字256码 是否取完了
JMP START
;欢
TABLE: DB 0CH,20H,3CH,10H
DB 44H,08H,84H,04H
DB 04H,03H,04H,03H
DB 84H,04H,44H,08H
DB 3CH,10H,00H,20H
DB 00H,00H,7H,20H
DB 04H,10H,0F4H,0FH
DB 04H, 10H,1CH,20H
;迎
DB 00H,00H,49H,20H
DB 6AH,10H,0D3H,0FH
DB 08H,10H,00H,20H
DB 0FEH,27H,02H,22H
DB 02H,21H,81H,20H
DB 00H,20H,02H,20H
DB 0FEH,2FH,02H,22H
DB 02H,22H,0FEH,21H
;莅
DB 00H,00H,82H,00H
DB 42H,00H,0E2H,3FH
DB 17H,00H,0AH,00H
DB 02H,00H,02H,00H
DB 22H,20H,22H,20H
DB 0E2H,3EH,3AH,20H
DB 0E7H,3FH,3AH,20H
DB 22H,20H,22H,20H
;临
DB 00H,00H,0F0H,03H
DB 00H,00H,00H,00H
DB 0FFH,3FH,00H,00H
DB 40H,20H,00H,3FH
DB 10H,21H,0FH,21H
DB 14H,21H,24H,3FH
DB 44H,21H,04H,21H
DB 04H,21H,04H,3FH
;民
DB 00H,00H,00H,20H
DB 0FFH,3FH,11H,21H
DB 11H,21H,11H,11H
DB 11H,09H,11H,01H
DB 11H,01H,11H,01H
DB 0F1H,03H,11H,05H
DB 11H,09H,1FH,11H
DB 00H,21H,00H,38H
;雄
DB 00H,00H,08H,11H
DB 88H,18H,48H,14H
DB 3FH,12H,08H,10H
DB 18H,10H,08H,38H
DB 04H,00H,0FEH,3FH
DB 45H,22H,44H,22H
DB 44H,22H,0FFH,3FH
DB 44H,22H,44H,22H
;农
DB 00H,00H,00H,00H
DB 1CH,04H,04H,04H
DB 04H,02H,04H,01H
DB 84H,00H,0C4H,3FH
DB 3FH,20H,44H,10H
DB 84H,00H,04H,01H
DB 04H,03H,84H,04H
DB 5CH,08H,00H,10H
;工
DB 00H,00H,00H,20H
DB 01H,20H,01H,20H
DB 01H,20H,01H,20H
DB 01H,20H,01H,20H
DB 0FFH,3FH,01H,20H
DB 01H,20H,01H,20H
DB 01H,20H,01H,20H
DB 01H,20H,01H,20H
END