下載中心 » 網友提供資料 > 江湖一點訣 :
如何使用Wait-Up From Pin Change?
下載的卻是 weak_up.zip
其內容 : 感覺應該是 wake_up From Pin Change , .....趕快更正吧!
另外一篇 何仁杰老師寫的 Wake-up from pin change使用範例程式 則為不錯看的範例
( PS : 中文註解寫的太詳細 , 好像在教小學生 ╮( ̄▽ ̄)╭ )
( 再 PS : ICD 的 DEMO BOARD 是用 16F877 , 但何老師卻用 16F870 ??? )
[color=0033FF]
LIST P=16C505
#INCLUDE "P16C505.INC"
PORTB EQU 6
PORTC EQU 7
org h'00'
RESET
BTFSC STATUS,7
GOTO WEAK_UP
MOVWF OSCCAL
INIT:
MOVLW H'FF'
TRIS PORTB
MOVLW H'00'
TRIS PORTC
MOVLW H'07'
OPTION
CLRF PORTB
CLRF PORTC
MOVFW PORTB
SLEEP
GOTO RESET
WEAK_UP
MOVLW H'00'
TRIS PORTC
MOVLW H'0F'
MOVWF PORTC
STUCK
GOTO STUCK
END
[/color]