;include "P16F676.inc" ;include the defaults for the chip
__config 0x3114 ;sets the configuration settings (oscillator type etc.)
; HERE SET TO INTERNAL OSCILLATOR 4MHZ
ORG 0
GOTO INIT
INIT
CLRF OPTION_REG
BSF STATUS,RP0
CLRF VRCON
MOVLW 0x3f
MOVWF TRISA ; porta as input
MOVLW 0x0
CLRF ANSEL ; disable ADC
MOVWF TRISC ; portb as output
BCF STATUS,RP0
MOVLW 0x7
MOVWF CMCON
START
btfss PORTA,1 ; test bit 1
call delay
GOTO START
delay
movlw 0xff
movwf PORTC
movlw 0fh
movwf 0x21
dECfsz 0x21,f
clrf PORTC
RETURN
end