標(biāo)題:
R8T3x單片機(jī)閃燈程序
[打印本頁(yè)]
作者:
zyluglugl
時(shí)間:
2023-4-29 11:43
標(biāo)題:
R8T3x單片機(jī)閃燈程序
BEGIN:
ORL 0B1H, #01EH ;P3CON 0x1e ;初始化P3.1-4為輸出
ORL 0C1H, #00FH ;C:P4CON(0xC1)初始化P4.0-3為輸出
LOOP:
CPL 0xC0.0 ;取反,閃燈
CPL 0xC0.1
CPL 0xB0.2
ACALL DELAY
AJMP LOOP ;(5)跳轉(zhuǎn)到第一句LOOP處
;以延時(shí)下子程序
;DELAY--------------------------
DELAY:
MOV R7, #200
DELAYLOOP1:
MOV R6, #200
DELAYLOOP2:
MOV R5, #100
DELAYLOOP3:
NOP
DJNZ R5, DELAYLOOP3
DJNZ R6, DELAYLOOP2
DJNZ R7, DELAYLOOP1
RET
END
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1