Các bạn cho tôi hỏi tại sao chương trình này tôi nạp=89c51 thì chạy nhưng thay bằng 89c52 thì nó tịt luôn mong các bật trưởng bối chỉ dẩn sơ dồ gởi kèm file chạy với Protues
$mod51
; BAI TAP: Truyen du lieu cho 74595 qua RxD
Din bit p3.0
clock bit p3.1
Lacth bit p3.7
flagOff bit p3.5
contro equ 30h
bodem equ 31h
col_setb equ 32h
socot equ 33h
;Quet cot P1
Khoitao: mov scon, #00h ;dat port noi tiep o model0
mov dptr, #thu2
mov contro, #0
mov bodem, #1
mov Col_setb, #00000001b
mov p1, #0
mov socot, #9
mov r5, #10
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, #1
djnz r5,loop
mov r5, #10
inc contro
mov a, contro
cjne a, #33,loop
jmp khoitao
;................................................. ...........................
;................................................. .............................
DichByte:
mov Sbuf, a
clr ti
jnb ti,$
ret
;................................................. .............................
DELAY:
;mov r7, #255
Llai: mov r6, #155
djnz r6, $
;djnz r7, Llai
RET
Thu2:
db 33,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
end
$mod51
; BAI TAP: Truyen du lieu cho 74595 qua RxD
Din bit p3.0
clock bit p3.1
Lacth bit p3.7
flagOff bit p3.5
contro equ 30h
bodem equ 31h
col_setb equ 32h
socot equ 33h
;Quet cot P1
Khoitao: mov scon, #00h ;dat port noi tiep o model0
mov dptr, #thu2
mov contro, #0
mov bodem, #1
mov Col_setb, #00000001b
mov p1, #0
mov socot, #9
mov r5, #10
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, #1
djnz r5,loop
mov r5, #10
inc contro
mov a, contro
cjne a, #33,loop
jmp khoitao
;................................................. ...........................
;................................................. .............................
DichByte:
mov Sbuf, a
clr ti
jnb ti,$
ret
;................................................. .............................
DELAY:
;mov r7, #255
Llai: mov r6, #155
djnz r6, $
;djnz r7, Llai
RET
Thu2:
db 33,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
end
Comment