Mong các bạn chỉ giúp tại sao với chương trình sau tôi nạp cho 89c51 thì nó chạy tốt nhưng khi thay = 89c52 thì nó không chạy đã thay vài 89c52 mới rồi
$mod51
;................................................. .................................................. .................................................. .......
; BAI TAP: Truyen du lieu cho 74595 qua RxD
;gom 1 led matrix 8x8 , quet cot bang port P1 xuat du lieu ra hang bang IC 74595+2803
;byte duoc dich vao chan 14 (Din ) qua chan p3.0 cua 89c51 bang phuong phap truyen noi tiep MODE 0
;................................................. .................................................. ....
Din bit p3.0 ;noi voi chan 14 cua IC74595
clock bit p3.1 ;noi voi chan 11 cua IC74595
Lacth bit p3.7 ;noi voi chan 12 cua IC74595
flagOff bit p3.5
contro equ 30h
bodem equ 31h
col_setb equ 32h
socot equ 33h
Khoitao: mov scon, #00h ;dat port noi tiep o model0
mov dptr, #thu2
mov contro, #0
mov bodem, #0
mov Col_setb, #00000001b
mov p1, #0
mov socot, #8
MAIN:
Hienthi:
loop:
cotke: clr Lacth
mov a, bodem
add a, contro
movc a, @a+dptr
call DichByte
mov p1, col_Setb
setb Lacth
call delay
mov p1, #0
mov a, col_setb
rl a
mov col_setb, a
inc Bodem
mov a, bodem
cjne a, socot,cotke
mov bodem, #0
djnz r5,loop
mov r5, #25
inc contro
mov a, contro
cjne a, #65,loop
jmp khoitao
;................................................. ...........................
;................................................. .............................
DichByte:
mov Sbuf, a
clr ti
jnb ti,$
ret
;................................................. .............................
DELAY:
mov r6, #255
djnz r6, $
RET
Thu2:
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,20h,7ch,22h ;t
db 00h,7eh,10h,10h,0eh ;h
db 00h,1ch,02h,42h,9eh,30h ;u?/
db 00h
db 00h,7eh,10h,10h,0eh ;h
db 00h,0ch,12h,12h,1eh ;a
db 00h,10h,5eh,02h ;i
db 0,0,0
;................................................. .............................
DichByte:
mov Sbuf, a
clr ti
jnb ti,$
ret
;................................................. .............................
DELAY:
;mov r7, #255
Llai: mov r6, #255
djnz r6, $
;djnz r7, Llai
RET
Thu2:
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,20h,7ch,22h ;t
db 00h,7eh,10h,10h,0eh ;h
db 00h,1ch,02h,42h,9eh,30h ;u?/
db 00h
db 00h,7eh,10h,10h,0eh ;h
db 00h,0ch,12h,12h,1eh ;a
db 00h,10h,5eh,02h ;i
db 0,0,0
$mod51
;................................................. .................................................. .................................................. .......
; BAI TAP: Truyen du lieu cho 74595 qua RxD
;gom 1 led matrix 8x8 , quet cot bang port P1 xuat du lieu ra hang bang IC 74595+2803
;byte duoc dich vao chan 14 (Din ) qua chan p3.0 cua 89c51 bang phuong phap truyen noi tiep MODE 0
;................................................. .................................................. ....
Din bit p3.0 ;noi voi chan 14 cua IC74595
clock bit p3.1 ;noi voi chan 11 cua IC74595
Lacth bit p3.7 ;noi voi chan 12 cua IC74595
flagOff bit p3.5
contro equ 30h
bodem equ 31h
col_setb equ 32h
socot equ 33h
Khoitao: mov scon, #00h ;dat port noi tiep o model0
mov dptr, #thu2
mov contro, #0
mov bodem, #0
mov Col_setb, #00000001b
mov p1, #0
mov socot, #8
MAIN:
Hienthi:
loop:
cotke: clr Lacth
mov a, bodem
add a, contro
movc a, @a+dptr
call DichByte
mov p1, col_Setb
setb Lacth
call delay
mov p1, #0
mov a, col_setb
rl a
mov col_setb, a
inc Bodem
mov a, bodem
cjne a, socot,cotke
mov bodem, #0
djnz r5,loop
mov r5, #25
inc contro
mov a, contro
cjne a, #65,loop
jmp khoitao
;................................................. ...........................
;................................................. .............................
DichByte:
mov Sbuf, a
clr ti
jnb ti,$
ret
;................................................. .............................
DELAY:
mov r6, #255
djnz r6, $
RET
Thu2:
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,20h,7ch,22h ;t
db 00h,7eh,10h,10h,0eh ;h
db 00h,1ch,02h,42h,9eh,30h ;u?/
db 00h
db 00h,7eh,10h,10h,0eh ;h
db 00h,0ch,12h,12h,1eh ;a
db 00h,10h,5eh,02h ;i
db 0,0,0
;................................................. .............................
DichByte:
mov Sbuf, a
clr ti
jnb ti,$
ret
;................................................. .............................
DELAY:
;mov r7, #255
Llai: mov r6, #255
djnz r6, $
;djnz r7, Llai
RET
Thu2:
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,00h,00h,00h,00h,00h,00h,0fh
db 00h,20h,7ch,22h ;t
db 00h,7eh,10h,10h,0eh ;h
db 00h,1ch,02h,42h,9eh,30h ;u?/
db 00h
db 00h,7eh,10h,10h,0eh ;h
db 00h,0ch,12h,12h,1eh ;a
db 00h,10h,5eh,02h ;i
db 0,0,0
Comment