ISR decfsz COUNT,F
goto Away
movlw .100 ;
movwf COUNT ;generating 1 sec part
incf Second,F
movf Second,W ;has it reached 5 sec?
xorlw .5
btfss STATUS,Z
goto Away1
btfss Enable,1 ;check the Enable bit?
goto Away1
[COLOR="Red"]bsf PORTB,0[/COLOR] ;turn ON after 5 seconds
nop
bcf Enable,1 ;turn off enable bit
[COLOR="Red"]clrf Second [/COLOR]
Away1 movf Second,W
xorlw .60
btfss STATUS,Z
goto Away
clrf Second
incf Minute,F
movf Minute,W
xorlw .5 ;has it reached 5 min?
btfss STATUS,Z
goto Away
clrf Minute
[COLOR="Red"]bcf PORTB,0[/COLOR] ;turn off after 5 mins
bsf Enable,1