INIT ;
BCF STATUS,RP0 ; select register bank 0
CLRF GPIO ; Init GPIO
movlw 07h ; set GP<2:0> to
movwf CMCON ; digital IO
BSF STATUS,RP0 ; BANK 1
clrf ANSEL ; Digital I/O
MOVLW B'00000010' ; Set GP<1> Input,
MOVWF TRISIO ; Set GP<0> as Output
clrf WPU ; Clear Weak pullup
bsf IOCB,IOCB1 ; Interrupt on change enable
[COLOR="Red"] call h'3FF'[/COLOR] ; You have to manually enter this value in the calibration input
[COLOR="Red"]movwf OSCCAL[/COLOR] ; h'3FF' is where the calibration value is stored. Usually 34xx
BCF STATUS,RP0 ; BANK 0
movlw D'250' ; Time in machine cycles to delay
movwf Niks1 ; before PIC goes to SLEEP