		LIST P=16F628
		RADIX HEX
#include <P16F628.INC>	;Se incluye la definicion de los registros

cblock	0x20
endc
					 	; internos en una libreria
#include <macros.inc>
;Este Programa, va ha contener los datos del Teclado
;Teniendo q este esta en el PORTB
;PORTB=[L4][L3][L2][L1][C3][C2][C1][C0]
;TRISB=  0   0   0   0   1   1   1   1

		ORG 0x00		;Inicio en el Vector de Reset
		goto INICIO
		ORG 0x05

;Incluyo librerias de Teclado
;Aqui hay 2 variables, TECLA y flag_tecla
;TECLA=> tecla Pressionada
;flag_tecla => Indica si se presiono Tecla
#include <teclado.inc>

;Incluye Distintos Retardos por Software
;ret10ms ret20ms ret30ms ret40ms
;ret50ms ret100ms ret200ms ret250ms
;ret500ms ret1seg
#include <retardos.inc>

INICIO
		movlw 7
		movwf CMCON			;PORTA =Entradas Digitales
		
		bsf   STATUS,RP0	; Paso al Banco 1
		bcf   STATUS,RP1
		clrf  PORTA
		clrf  VRCON			;A/D Voltaje de Referencia Desabilitado
		bcf   STATUS,RP0	;Regreso al Banco 0

		call CONFIGURA_TECLADO
repite
		call LEO_TECLADO
		compara flag_tecla,0
		jz repite
		movr PORTA,TECLA
		ret1seg
		goto repite		
END

