定时50ms,软件计数5次
ORG 0000H
LJMP START
ORG 000BH
LJMP Timer0Interrupt
START:
MOV SP,#60H
MOV TMOD,#01H
MOV TH0,#3CH
MOV TL0,#0B0H
MOV R7,#5
SETB P1.0;输出方波引脚
SETB EA
SETB ET0
SETB TR0
SJMP $
Timer0Interrupt:
MOV TH0,#3CH
MOV TL0,#0B0H
DJNZ R7,RT
MOV R7,#5
CPL P1.0
RT: RETI
END