#include <p16F690.inc>
errorlevel -302
__config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF)
cblock 0x20
d1 ; Define three file registers for the
d2 ; delay loop
d3
endc
org 0
Start:
bsf STATUS,RP0 ; select Register Page 1
bcf TRISC,0 ; make IO Pin C0 an output
bcf STATUS,RP0 ; back to Register Page 0
bsf PORTC,0 ; turn on LED C0
call Delay ; delay so you can see the LED is on
bcf PORTC,0 ; turns off LED C0
call Delay ; delay so Led will be off so you can see it blink
goto Start ; wait here
Delay:
;499994 cycles
movlw 0x03
movwf d1
movlw 0x18
movwf d2
movlw 0x02
movwf d3
Delay_0:
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto Delay_0
;2 cycles
goto $+1
;4 cycles (including call)
return
end