#include <p12f629.inc>
__CONFIG (_MCLRE_OFF & _CP_OFF & _WDT_OFF & _INTRC_OSC_NOCLKOUT)  ;Internal osc.
 
  c1 equ 20        ; counter 1
  c2 equ 21        ; counter 2

 org 00

Start
 BCF   STATUS,RP0  ; select bank 0
 CLRF  GPIO       ; set GPIO pins equal to 0 volts
 movlw b'11111111'
 movwf CMCON
 BSF   STATUS,RP0  ; select bank 1
 CLRF  TRISIO      ; make GPIO pins all output
 BCF   STATUS,RP0  ; select bank 0

loop
 movlw b'00000100' ; choose the output pin, 5
 movwf GPIO        ; put 3 volts on pin 5
 call delay1
 movlw b'00000000' ; choose 0 volts on all output pins
 movwf GPIO        ; put 0 volts on pin 5
 call delay1
 goto loop

delay1               ; a delay of around 10 msec
 movlw b'00010000'
 bcf STATUS,RP0
 movwf c2            ; set counter 2 to 16
lc0
 movlw b'11111111'
 movwf c1            ; set counter 1 to 255
lc1
 decfsz c1,1         ; decrease c1 by one
 goto lc1            ; if not zero, go to lc1
 decfsz c2,1         ; if c1=0, decrease c2 by one
 goto lc0            ; if c2 is not zero, go to lc0
 return              ; if c2 =0, return

 end
