ORG 0000H
LJMP MAIN
ORG 000BH
LJMP T0ISR
ORG 0030H
MAIN:
MOV TMOD,#01H
MOV TH0,#HIGH(65536-50000)
MOV TL0,#LOW(65536-50000)
SETB TR0
SETB ET0
SETB EA
MOV A,#0FEH
MOV P1,A
MOV R2,#24
MOV R3,#10
SJMP $
T0ISR:
CLR TR0
MOV TH0,#HIGH(65536-50000)
MOV TL0,#LOW(65536-50000)
SETB TR0
DJNZ R3,T0E
MOV R3,#10
RL A
MOV P1,A
DJNZ R2,T0E
MOV P1,#0FFH
CLR TR0
T0E:
RETI
END
想要定时,先要说清楚,你用的晶振频率是多少。