em viết chương trình cho matrix 8x64 chạy dồi nhưng khi chạy nó bị thiếu nét
em cho chay chữ WECOME nhưng khi chay thì hiện o hoàn chỉnh
các bác giúp em voi vd như chữ W thì hiện thiếu trong khi em lấy mã quét đúng dồi
em dùng 74HC595 để quét cột,74373 để đệm hàng
code đây các bác xem dồi sủa cho em nhé:
; chung trinh quet led matrix 3 led 8x8
;su dung 74hc595 de quet cot
;p1 du lieu hang
$include(reg51.inc)
hang equ p1
dulieu bit p2.0
clk bit p2.1
org 0000h
clr dulieu
clr clk
main:
mov dptr,#ma
acall taoxung
b1: mov r2,#100 ;so chu ky lap lai hay toc do quet
b4: mov r3,#00 ;bien dem so cot
mov r1,#00 ;bien dem data
b3: clr a
mov a,r1
movc a,@a+dptr
mov hang ,a
setb clk
acall tre
clr clk
acall delay
inc r3
inc r1
cjne r3,#48,b3
acall taoxung
djnz r2,b4
inc dptr
mov a,dpl
cjne a,#80,b1
sjmp main
delay:mov r5,#1
k1:mov r6,#20
djnz r6,$
djnz r5,k1
ret
taoxung:setb dulieu
setb clk
clr clk
clr dulieu
ret
tre: mov r7,#10
djnz r7,$
ret
org 0500h
ma: DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
DB 0FFH,81H,0DFH,0EFH,0DFH,81H,0FFH,0FFH
DB 0FFH,81H,0ADH,0ADH,0ADH,0FFH,0FFH,0FFH
DB 0FFH,0C3H,0BDH,0BDH,0BDH,0FFH,0FFH,0FFH
DB 0FFH,0C3H,0BDH,0BDH,0BDH,0C3H,0FFH,0FFH
DB 0FFH,81H,0FBH,0F7H,0FBH,81H,0FFH,0FFH
DB 0FFH,81H,0ADH,0ADH,0ADH,0FFH,0FFH,0FFH
DB 0FFH,81H,0BDH,0BDH,0C3H,0FFH,0FFH,0FFH,0F3H,0EDH,0 DDH,0BBH,0DDH,0EDH,0F1H,0FFH,0FFH,0FFH,81H,0F7H,0F 7H,0D7H,81H,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
END
em mới làm về led ma trận mong các bác sủa cho em.
mạch của em day:
em cho chay chữ WECOME nhưng khi chay thì hiện o hoàn chỉnh
các bác giúp em voi vd như chữ W thì hiện thiếu trong khi em lấy mã quét đúng dồi
em dùng 74HC595 để quét cột,74373 để đệm hàng
code đây các bác xem dồi sủa cho em nhé:
; chung trinh quet led matrix 3 led 8x8
;su dung 74hc595 de quet cot
;p1 du lieu hang
$include(reg51.inc)
hang equ p1
dulieu bit p2.0
clk bit p2.1
org 0000h
clr dulieu
clr clk
main:
mov dptr,#ma
acall taoxung
b1: mov r2,#100 ;so chu ky lap lai hay toc do quet
b4: mov r3,#00 ;bien dem so cot
mov r1,#00 ;bien dem data
b3: clr a
mov a,r1
movc a,@a+dptr
mov hang ,a
setb clk
acall tre
clr clk
acall delay
inc r3
inc r1
cjne r3,#48,b3
acall taoxung
djnz r2,b4
inc dptr
mov a,dpl
cjne a,#80,b1
sjmp main
delay:mov r5,#1
k1:mov r6,#20
djnz r6,$
djnz r5,k1
ret
taoxung:setb dulieu
setb clk
clr clk
clr dulieu
ret
tre: mov r7,#10
djnz r7,$
ret
org 0500h
ma: DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
DB 0FFH,81H,0DFH,0EFH,0DFH,81H,0FFH,0FFH
DB 0FFH,81H,0ADH,0ADH,0ADH,0FFH,0FFH,0FFH
DB 0FFH,0C3H,0BDH,0BDH,0BDH,0FFH,0FFH,0FFH
DB 0FFH,0C3H,0BDH,0BDH,0BDH,0C3H,0FFH,0FFH
DB 0FFH,81H,0FBH,0F7H,0FBH,81H,0FFH,0FFH
DB 0FFH,81H,0ADH,0ADH,0ADH,0FFH,0FFH,0FFH
DB 0FFH,81H,0BDH,0BDH,0C3H,0FFH,0FFH,0FFH,0F3H,0EDH,0 DDH,0BBH,0DDH,0EDH,0F1H,0FFH,0FFH,0FFH,81H,0F7H,0F 7H,0D7H,81H,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH, 0FFH,0FFH,0FFH,0FFH
END
em mới làm về led ma trận mong các bác sủa cho em.
mạch của em day:
Comment