单片机高手速度进来,,,谢谢!!!!!

2025-01-04 07:34:43
推荐回答(3个)
回答1:

;程序如下:
ORG 0000H
SJMP START
ORG 001BH
SJMP INT_T1
START:
MOV TMOD, #10H
MOV TH1, #3CH
MOV TL1, #0B0H ;定时50ms
SETB TR1
SETB ET1
SETB EA
MOV R2, #0
MOV R3, #20
CLR PSW.5
_0_: JNB PSW.5, $
CLR PSW.5
_1_: CJNE R2, #1, _2_
CLR P1.0
SJMP _0_
_2_: CJNE R2, #2, _3_
CLR P1.1
SJMP _0_
_3_: CJNE R2, #3, _4_
CLR P1.2
SJMP _0_
_4_: CJNE R2, #4, _5_
CLR P1.3
SJMP _0_
_5_: CJNE R2, #5, _6_
CLR P1.4
SJMP _0_
_6_: MOV P1, #255
MOV R2, #0
SJMP _0_

INT_T1:
MOV TH1, #3CH
MOV TL1, #0B0H ;定时50ms
DJNZ R3, _EXIT_
MOV R3, #20
SETB PSW.5
INC R2
_EXIT_:
RETI
END

回答2:

c 不行吗?

回答3:

现在学习C比较实用和移植性好点,还需要汇编啊