Em làm led ma trận mà giờ cần viết chương trình chống lem nhưng không biết, ai biết giúp em với ạ. E cần gấp lắm
Đoạn code:
File mô phỏng và code e đính kèm bên dưới lun.
Đoạn code:
ORG 0000H
MOV DPTR,#DULIEU
LOOP: MOV R2,#0
LOOP2: MOV R5,#32
LOOP1: MOV R0,#0
MOV R1,#0
LOOP3: MOV A,R1
MOV P2,A
MOV A,R0
ADD A,R2
MOVC A,@A+DPTR
MOV P1,A
CALL DELAY
INC R0
INC R1
CJNE R1,#24,LOOP3
DJNZ R5,LOOP1
INC R2
CJNE R2,#183,LOOP2
LJMP LOOP
DELAY:
MOV R7,#80
DJNZ R7,$
RET
;===========================
DULIEU: ; ĐH SPKT TP.HCM
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 000H,000H,000H,091H,0FFH,0FFH,091H,081H,0C3H,07EH, 03CH
DB 000H,081H,0FFH,0FFH,089H,008H,089H,0FFH,0FFH,081H, 000H,000H,0EEH,089H,099H,092H
DB 077H,000H,000H,081H,0FFH,0FFH,091H,01FH,00EH,000H, 081H,0FFH,0FFH,091H,018H,0BDH
DB 0E3H,0C1H,081H,006H,003H,081H,0FFH,0FFH,081H,001H, 007H,000H,000H,000H,006H,003H
DB 081H,0FFH,0FFH,081H,001H,007H,000H,081H,0FFH,0FFH, 091H,01FH,00EH,000H,0C0H,0C0H
DB 000H,081H,0FFH,0FFH,089H,008H,089H,0FFH,0FFH,081H, 000H,000H,03CH,07EH,0C3H,081H
DB 081H,082H,067H,000H,081H,0FFH,083H,03FH,0F0H,038H, 087H,0FFH,0FFH,081H,081H
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H
;=======================================
END
MOV DPTR,#DULIEU
LOOP: MOV R2,#0
LOOP2: MOV R5,#32
LOOP1: MOV R0,#0
MOV R1,#0
LOOP3: MOV A,R1
MOV P2,A
MOV A,R0
ADD A,R2
MOVC A,@A+DPTR
MOV P1,A
CALL DELAY
INC R0
INC R1
CJNE R1,#24,LOOP3
DJNZ R5,LOOP1
INC R2
CJNE R2,#183,LOOP2
LJMP LOOP
DELAY:
MOV R7,#80
DJNZ R7,$
RET
;===========================
DULIEU: ; ĐH SPKT TP.HCM
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 000H,000H,000H,091H,0FFH,0FFH,091H,081H,0C3H,07EH, 03CH
DB 000H,081H,0FFH,0FFH,089H,008H,089H,0FFH,0FFH,081H, 000H,000H,0EEH,089H,099H,092H
DB 077H,000H,000H,081H,0FFH,0FFH,091H,01FH,00EH,000H, 081H,0FFH,0FFH,091H,018H,0BDH
DB 0E3H,0C1H,081H,006H,003H,081H,0FFH,0FFH,081H,001H, 007H,000H,000H,000H,006H,003H
DB 081H,0FFH,0FFH,081H,001H,007H,000H,081H,0FFH,0FFH, 091H,01FH,00EH,000H,0C0H,0C0H
DB 000H,081H,0FFH,0FFH,089H,008H,089H,0FFH,0FFH,081H, 000H,000H,03CH,07EH,0C3H,081H
DB 081H,082H,067H,000H,081H,0FFH,083H,03FH,0F0H,038H, 087H,0FFH,0FFH,081H,081H
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H
DB 00H,00H,00H,00H,00H,00H,00H,00H
;=======================================
END
Comment