專注差異化嵌入式產(chǎn)品解決方案 給智能產(chǎn)品定制注入靈魂給予生命
提供開(kāi)發(fā)工具、應(yīng)用測(cè)試 完善的開(kāi)發(fā)代碼案例庫(kù)分享
從全面的產(chǎn)品導(dǎo)入到強(qiáng)大技術(shù)支援服務(wù) 全程貼心伴隨服務(wù),創(chuàng)造無(wú)限潛能!
提供新的芯片及解決方案,提升客戶產(chǎn)品競(jìng)爭(zhēng)力
提供最新的單片機(jī)資訊,行業(yè)消息以及公司新聞動(dòng)態(tài)
INCLUDE "P16F877A.INC"
COUNTER EQU 25H
ORG 0000H
NOP
MAIN
BSF STATUS,5
MOVLW 0F0H
MOVWF TRISD
MOVLW 00H
MOVWF TRISC
BCF STATUS,5
MOVLW 00H
MOVWF PORTC
CLRF COUNTER
ST
CALL KSM
GOTO ST
;
;
;
KSM
BTFSC PORTD,4
GOTO BACK
PAGESEL DEL10MS
CALL DEL10MS
PAGESEL KSM
BTFSC PORTD,4
GOTO BACK
PPA
BTFSS PORTD,4
GOTO PPA
PAGESEL DEL10MS
CALL DEL10MS
PAGESEL KSM
BTFSS PORTD,4
GOTO PPA
INCF COUNTER
MOVLW 03H
ANDWF COUNTER,W
ADDWF PCL,F
GOTO XSH1
GOTO XSH2
GOTO XSH3
GOTO XSH4
BACK
NOP
RETURN
;
;
;
XSH1
MOVLW 0FH
MOVWF PORTC
CALL DELAY1S
MOVLW 0F0H
MOVWF PORTC
CALL DELAY1S
CALL KSM
GOTO XSH1
;
;
;
XSH2
INCF PORTC
CALL DELAY1S
CALL KSM
GOTO XSH2
;
;
;
XSH3
MOVLW 55H
MOVWF PORTC
CALL DELAY1S
MOVLW 0AAH
MOVWF PORTC
CALL DELAY1S
CALL KSM
GOTO XSH3
;
;
;
XSH4
MOVLW 03H
MOVWF PORTC
CALL DELAY1S
MOVLW 0CH
MOVWF PORTC
CALL DELAY1S
MOVLW 30H
MOVWF PORTC
CALL DELAY1S
MOVLW 0C0H
MOVWF PORTC
CALL DELAY1S
CALL KSM
GOTO XSH4
DELAY1S
MOVLW 01H
MOVWF 20H
LOOP1
MOVLW 0EBH
MOVWF 21H
LOOP2 MOVLW 0ECH
MOVWF 22H
LOOP3 DECFSZ 22H,1
GOTO LOOP3
DECFSZ 21H,1
GOTO LOOP2
DECFSZ 20H,1
GOTO LOOP1
RETURN
;
;
;
ORG 0100H
DEL10MS
MOVLW 04H
MOVWF 123H
L1
MOVLW 0FFH
MOVWF 124H
L2 DECFSZ 124H,1
GOTO L2
DECFSZ 123H,1
GOTO L1
RETURN
END