	
	;blank12F629.asm
	;This program is a blank template for PIC12F629  17-12-2005 


	list	p=12F629
	radix	dec
	include	"p12f629.inc"

	__CONFIG	_MCLRE_OFF & _CP_OFF & _WDT_OFF & _INTRC_OSC_NOCLKOUT  ;Internal osc.

	
				; globals
 		equ 	20h	;this is the first available file
 		equ 	21h
 		equ 	22h
		equ 	23h
 		equ 	24h
		equ	25h

fileA		equ	26h	;delay fileA
fileB		equ	27h	;delay fileB
filec		equ	28h	;delay fileC

				; bits on GPIO
				
pin7		equ	0	;GP0  
pin6	 	equ	1	;GP1
pin5		equ	2	;GP2
pin4		equ	3	;GP3 
pin3		equ	4	;GP4 
pin2		equ	5	;GP5 
		


Start	org	0x0000		;program starts at location 000
	nop
	nop
	nop
	nop			;NOPs to get past reset vector address
	nop
	nop

		
SetUp	bsf	STATUS, rp0 	;Bank 1
	
	movlw	b'10000110'	;Turn off T0CKI, prescale for TMR0 = 1:128
	movwf	OPTION_REG

	movlw	b'00110111'	;Example: Set GP0 (pin 7) as output
	movwf	TRISIO
	
				
			;calibrating the internal oscillator

	
	call	0x3ff		;get the calibration value
	movwf	OSCCAL		;calibrate oscillator
	bcf	status, rp0	;bank 0

	clrf 	GPIO       	;Clear GPIO of junk	
	goto 	Main		
	
 

	
	
	;Delay 0.51 sec

Del_1	movlw 40h
	movwf fileC	
DelX	decfsz fileA,1		; ,1 denotes the result of the decrement 
	goto DelX	
	decfsz fileB,1		;     is placed in the file	
	goto DelX
	decfsz fileC,1
	goto DelX
	retlw 00
		
	
Main	your instruction goes here
	your instruction goes here
	call Del_1
	your instruction goes here
	your instruction goes here
	goto Main


		;OSCCAL calibration value

	org	0x3ff
	movlw	0x20
		

	end
		

	
	