em đa có được code rồi nhưng phấn cứng không biết có phù hợp không, mong các anh trợ giúp
đây là code
ORG 00H
MAIN:
MOV DPTR,#MACHU
MOV R6,#89
CHAY:MOV R7,#10
QUET:
MOV R0,#0
MOV R1,#00000001B
LAP2:
MOV P0,R1
MOV A,R1
RL A
MOV R1,A
MOV A,R0
MOVC A,@A+DPTR
MOV P1,A
CALL DELAY
INC R0
CJNE R0,#8,LAP2
MOV P0,#00H
LAP:
MOV P2,R1
MOV A,R1
RL A
MOV R1,A
MOV A,R0
MOVC A,@A+DPTR
MOV P1,A
CALL DELAY
INC R0
CJNE R0,#16,LAP
MOV P2,#00H
LAP1:
MOV P3,R1
MOV A,R1
RL A
MOV R1,A
MOV A,R0
MOVC A,@A+DPTR
MOV P1,A
CALL DELAY
INC R0
CJNE R0,#24,LAP1
MOV P3,#00H
DJNZ R7,QUET
INC DPTR
DJNZ R6,CHAY
JMP MAIN
DELAY:
MOV TMOD,#01H
MOV TH0,#HIGH(-1000)
MOV TL0,#LOW(-1000)
SETB TR0
JNB TF0,$
CLR TF0
CLR TR0
RET
ORG 500
MACHU:
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH; ma trong
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH; het ma
DB 0FFH,81H,81H,0BDH,0BDH,0C3H
DB 0FFH,0C3H,81H,0BDH,0BDH,81H,0C3H,0FFH
DB 0FFH,87H,83H,0EDH,0EDH,0EBH,87H
DB 0FFH,81H,81H,0FBH,0F7H,0EFH,81H,0FFH
DB 0FFH,81H,81H,0FBH,0F7H,0FBH,81H
DB 0FFH,0C3H,81H,0BDH,0BDH,81H,0C3H
DB 0FFH,81H,81H,0FBH,0F7H,0EFH,81H
DB 0FFH,81H,81H,0E7H,0E7H,81H
DB 0FFH,0C3H,81H,0BDH,0BDH,81H,0C3H
DB 0FFH,0C3H,81H,0BDH,0BDH,0DBH,0FFH,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH; bat dau ma khac
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
RET
END
em sử dung code tren tao ra fire hẽ và nap vào chip rồi mấy anh cho e xin mạch thực tế chạy đươc với code này e cam ơn
đây là code
ORG 00H
MAIN:
MOV DPTR,#MACHU
MOV R6,#89
CHAY:MOV R7,#10
QUET:
MOV R0,#0
MOV R1,#00000001B
LAP2:
MOV P0,R1
MOV A,R1
RL A
MOV R1,A
MOV A,R0
MOVC A,@A+DPTR
MOV P1,A
CALL DELAY
INC R0
CJNE R0,#8,LAP2
MOV P0,#00H
LAP:
MOV P2,R1
MOV A,R1
RL A
MOV R1,A
MOV A,R0
MOVC A,@A+DPTR
MOV P1,A
CALL DELAY
INC R0
CJNE R0,#16,LAP
MOV P2,#00H
LAP1:
MOV P3,R1
MOV A,R1
RL A
MOV R1,A
MOV A,R0
MOVC A,@A+DPTR
MOV P1,A
CALL DELAY
INC R0
CJNE R0,#24,LAP1
MOV P3,#00H
DJNZ R7,QUET
INC DPTR
DJNZ R6,CHAY
JMP MAIN
DELAY:
MOV TMOD,#01H
MOV TH0,#HIGH(-1000)
MOV TL0,#LOW(-1000)
SETB TR0
JNB TF0,$
CLR TF0
CLR TR0
RET
ORG 500
MACHU:
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH; ma trong
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH; het ma
DB 0FFH,81H,81H,0BDH,0BDH,0C3H
DB 0FFH,0C3H,81H,0BDH,0BDH,81H,0C3H,0FFH
DB 0FFH,87H,83H,0EDH,0EDH,0EBH,87H
DB 0FFH,81H,81H,0FBH,0F7H,0EFH,81H,0FFH
DB 0FFH,81H,81H,0FBH,0F7H,0FBH,81H
DB 0FFH,0C3H,81H,0BDH,0BDH,81H,0C3H
DB 0FFH,81H,81H,0FBH,0F7H,0EFH,81H
DB 0FFH,81H,81H,0E7H,0E7H,81H
DB 0FFH,0C3H,81H,0BDH,0BDH,81H,0C3H
DB 0FFH,0C3H,81H,0BDH,0BDH,0DBH,0FFH,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH; bat dau ma khac
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
RET
END
em sử dung code tren tao ra fire hẽ và nap vào chip rồi mấy anh cho e xin mạch thực tế chạy đươc với code này e cam ơn