MCS-51单片机设计一方波发生器,周期为500ms的程序。汇编语言!

2024-12-02 12:36:04
推荐回答(1个)
回答(1):

定时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