松翰單片機(jī)閃爍程序
//{{SONIX_CODE_OPTION
.Code_OptionWDT_CLKFlosc/4
.Code_OptionReset_PinP04
.Code_OptionLVDLVD_Max; 3.3V Reset
.Code_OptionWatch_DogDisable;關(guān)閉看門(mén)狗
.Code_OptionLow_FcpuFlosc/1
.Code_OptionHigh_ClkIHRC_16M; Internal 16M RC Oscillator
.Code_OptionHigh_FcpuFhosc/1
.Code_OptionSecurityEnable
.Code_OptionNoise_FilterEnable
code down:http://www.51hei.com/f/shssd.rar
//}}SONIX_CODE_OPTION
LEDEQUP0.2;LED連接口
LED0EQUP0M.2;I/o口輸入輸出狀態(tài)控制
ORG0
JMPA1
ORG15
A1:B0BSETLED0;設(shè)置P0.2為輸出狀態(tài)
B0BCLRLED;輸出低電平點(diǎn)亮LED
CALLM001;延時(shí)
B0BSETLED;輸出高電平熄滅LED
CALLM001;延時(shí)
JMPA1;循環(huán)執(zhí)行程序
;******************************************
;延時(shí)子程序
;******************************************
M001:MOVA,#20
MOV51H,A
M002:MOVA,#248
MOV52H,A
M003:MOVA,#250
MOV53H,A
M004:DECMS53H
JMPM004
DECMS52H
JMPM003
DECMS51H
JMPM002
RET
;*****************************************
;程序結(jié)束
;*****************************************
ENDP
評(píng)論