求助 单片机点阵显示屏无法重复显示怎么回事 点击:512 | 回复:0



冲锋陷阵

    
  • 精华:0帖
  • 求助:1帖
  • 帖子:8帖 | 118回
  • 年度积分:0
  • 历史总积分:658
  • 注册:2008年4月30日
发表于:2008-06-26 19:44:00
楼主

我用单片机AT89S52做了一个16*16点阵显示屏,P0、P2口经三极管放大之后接屏的正极,P1口经74HC154(4线16线译码器)译码之后接屏的负极,输入程序后,只能显示一遍字,不能循环显示,之后整个屏就全亮。为什么?请高手指点。LJMP MAIN 为什么不行?是不是显示的字太多啦!

程序:ORG 0000H
AJMP MAIN
ORG 0030H
MAIN: MOV DPTR,#TAB ;字码表初址赋值
MOV R1,#00H ;列控制码
MOV R3,#16 ;列数
MOV R4,#39;移动" "及"单片机仿真39个字符,共624列
MOV B,#16
CM: MOV R5,#5 ;每屏反复显示5次
MOV R3,#16 ;列数
C1: MOV R2,#0 ;取码指针
C16: MOV P0,#00H
MOV P3,#00H ;关显示
CLR P2.0
MOV A,R2
MOVC A,@A+DPTR ;取当前列显示字码的第一个字节
MOV P2,A ;送1~8行控制口
INC R2
MOV A,R2
MOVC A,@A+DPTR ;取当前列的显示字码的第二个字节
MOV P0,A ;送9~15行控制口
INC R2
MOV P1,R1 ;送列控制码
INC R1
ACALL D1MS ;显示1MS
ACALL D1MS
DJNZ R3,C16
MOV R3,#16
DJNZ R5,C1 ;未显示5次,继续
INC DPTR ;一屏反复显示5次完,字码表初值加2
INC DPTR
DJNZ B,CM
DJNZ R4,CM ;624列未移动完,继续
LJMP MAIN ;624列移动完,返回,重新从" "开始显示
D1MS: MOV R6,#1
LI:MOV R7,#248
DJNZ R7,$
DJNZ R6,LI ?
RET
tab :DB 04H,20H,24H,20H,24H,44H,24H,88H
DB 0FDH,30H,26H,02H,24H,01H,25H,0FEH
DB 24H,10H,26H,08H,0FDH,20H,24H,90H
DB 64H,4CH,2CH,60H,04H,40H,00H,00H

DB 01H,00H,22H,00H,24H,01H,0F9H,0F9H
DB 21H,02H,25H,02H,23H,04H,3DH,78H
DB 01H,04H,3DH,04H,25H,02H,27H,0FAH
DB 25H,01H,7CH,00H,20H,00H,00H,00H

DB 08H,02H,08H,44H,0FH,0A8H,0F8H,10H
DB 08H,28H,1FH,0C6H,08H,02H,7FH,0FEH
DB 44H,42H,44H,42H,44H,42H,44H,42H
DB 0FFH,0FEH,40H,02H,00H,02H,00H,00H

DB 08H,02H,08H,44H,0FH,0A8H,0F8H,10H
DB 08H,28H,1FH,0C6H,08H,02H,7FH,0FEH
DB 44H,42H,44H,42H,44H,42H,44H,42H
DB 0FFH,0FEH,40H,02H,00H,02H,00H,00H

DB 02H,04H,22H,88H,2AH,92H,0A6H,81H
DB 63H,0FEH,26H,80H,6BH,0A0H,22H,94H
DB 02H,18H,3FH,0E0H,22H,00H,42H,00H
DB 0C3H,0FFH,46H,00H,02H,00H,00H,00H

DB 08H,02H,08H,44H,0FH,0A8H,0F8H,10H
DB 08H,28H,0FH,0C6H,00H,00H,7FH,7FH
DB 49H,49H,4AH,49H,78H,49H,4EH,49H
DB 89H,49H,98H,0FFH,09H,80H,00H,00H

DB 00H,00H,08H,04H,08H,08H,08H,08H
DB 08H,14H,08H,12H,88H,22H,68H,42H
DB 08H,82H,09H,02H,0AH,02H,0CH,02H
DB 08H,02H,00H,06H,00H,04H,00H,00H

DB 00H,40H,40H,40H,50H,40H,57H,5FH
DB 55H,52H,55H,0D2H,55H,52H,0F5H,52H
DB 55H,52H,55H,0D2H,55H,52H,57H,7FH
DB 0D0H,50H,40H,0C0H,00H,40H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,38H,00H,7FH,0CCH
DB 7FH,0CCH,38H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H ;!

DB 00H,10H,00H,21H,7FH,0C6H,40H,00H
DB 4FH,9EH,4AH,0A1H,5AH,81H,6AH,99H
DB 4AH,0F5H,4AH,81H,4AH,81H,4AH,0A7H
DB 0DFH,90H,48H,04H,00H,03H,00H,00H

DB 08H,02H,08H,44H,0FH,0A8H,0F8H,10H
DB 08H,28H,1FH,0C6H,08H,02H,7FH,0FEH
DB 44H,42H,44H,42H,44H,42H,44H,42H
DB 0FFH,0FEH,40H,02H,00H,02H,00H,00H

DB 08H,02H,08H,44H,0FH,0A8H,0F8H,10H
DB 08H,28H,1FH,0C6H,08H,02H,7FH,0FEH
DB 44H,42H,44H,42H,44H,42H,44H,42H
DB 0FFH,0FEH,40H,02H,00H,02H,00H,00H

DB 00H,00H,00H,00H,00H,20H,00H,10H
DB 00H,1CH,00H,0CH,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H

DB 08H,02H,08H,44H,0FH,0A8H,0F8H,10H
DB 08H,28H,1FH,0C6H,08H,02H,7FH,0FEH
DB 44H,42H,44H,42H,44H,42H,44H,42H
DB 0FFH,0FEH,40H,02H,00H,02H,00H,00H

DB 01H,00H,11H,01H,11H,01H,11H,02H
DB 11H,04H,11H,18H,11H,60H,0FFH,80H
DB 11H,60H,11H,18H,11H,04H,11H,04H
DB 31H,02H,13H,03H,01H,02H,00H,00H

DB 00H,00H,00H,00H,00H,0CCH,00H



热门招聘
相关主题

官方公众号

智造工程师