Follow along with the video below to see how to install our site as a web app on your home screen.
							
						
Nota: This feature currently requires accessing the site using the built-in Safari browser.
'*****************************************************************
@ DEVICE PIC16F876A,WDT_OFF,PWRT_OFF,BOD_OFF,CPD_OFF,PROTECT_OFF
define osc 20 'Esto es para usar un oscilador de cristal de 20 mhz
'los siguientes "define" son para definir las patitas del LCD que utilizaras
DEFINE LCD_DREG PORTC 'el lcd se colocará en el puerto c del pic
DEFINE LCD_DBIT 0	'Datos sera con las patitas: C0-C3
DEFINE LCD_RSREG PORTC
DEFINE LCD_RSBIT 4	'Bit de registro C4
DEFINE LCD_EREG PORTC
DEFINE LCD_EBIT 5	'Bit de enable C5
ADCON1 = 6 'Puerto A como E/S digital
'escribe en el LCD el texto "Insertar LLave"
LCDOUT $FE,1,"Inserta llave"
'*****************************************************************
	TEXTO      addwf	PCL
dt "dOlPhIn",0x00
	TEXTO    addwf	PCL,F
              retlw          "d"
              retlw          "O"
              retlw          "l"
              retlw          "P"
              retlw          "h"
              retlw          "I"
              retlw          "n"
              retlw          0x00
	LIST P=PIC16F877A 
INCLUDE "P16F877A.INC"
cblock	0x20
PDel0
PDel1
TABLA
REGISTRO
endc
__CONFIG    0x3F3A
#define	LCD_EN PORTC,0				;Definciones de I/O
#define	LCD_RS PORTC,1
org     0x00
goto    INICIO
org     0x05
TEXTO		addwf	PCL,F
			dt "Hola",0x00			;Mensaje a enviar la parte de ",0x00" marca el final del mensaje asi es mas facil de neviar los msgs
INICIO	bsf		STATUS,RP0			;Declaracion de entradas y salidas
		movlw	b'00000000'			
		movwf	PORTB
		movlw	b'11111100'
		movwf	PORTC
		bcf		STATUS,RP0
		clrf	TABLA
call		LCD_INI					;Retardo para inicializar el LCD
	    	movlw	0x38			;Configuracion del LCD a datos de 8 bits, .
			call	INSTRU			;llamada a la instruccion (checar la hoja de datos del LCD para mejor entendimiento)
			movlw	0x0C			
			call	INSTRU
			movlw	0x06
			call	INSTRU
			movlw	0x02
			call	INSTRU
			bsf		LCD_RS
			bsf		LCD_EN
	
LCD			bcf		STATUS,Z
			movfw	TABLA
			incf    TABLA,F
			call	TEXTO 
			movwf	REGISTRO
			movf	REGISTRO,F
			btfsc	STATUS,Z
FIN			goto	FIN
			call 	DATO
			goto    LCD
INSTRU		bcf		LCD_RS			;Subrutina de instrucciones
			goto	ENVIO
DATO		bsf		LCD_RS			;Subrutina de envio de datos
			movfw	REGISTRO
ENVIO		bsf		LCD_EN	;E=1
			nop
			movwf	PORTB
			call	DOSMS
			bcf		LCD_EN ;E=0
			nop
			return
;..............................................................................................................................
													RETARDOS
;..............................................................................................................................	
DOSMS   	movlw   .250     
        	movwf   PDel0    
PLoop01 	clrwdt           
PDelL11 	goto 	PDelL21  
PDelL21 	goto 	PDelL31  
PDelL31  
        	decfsz  PDel0, 1  
        	goto    PLoop01   
PDelL41 	goto 	PDelL51   
PDelL51 	clrwdt            
        	return            
                 
		
LCD_INI   	movlw     .255     
        	movwf     PDel0     
PLoop1  	movlw     .253     
        	movwf     PDel1     
PLoop2  	clrwdt              
        	clrwdt              
        	decfsz    PDel1, 1  
        	goto      PLoop2    
        	decfsz    PDel0,  1 
        	goto      PLoop1    
PDelL1  	goto 	  PDelL2        
PDelL2  
        	return        
			end
	                LIST                        
        DIVIDENDO EQU  20H        definicion de los bits                
        DIVISOR EQU 21H        
        RESP EQU 22H        
        BSF STATUS,RP0        pasamos al banco 1
        MOVLW 0FFH        ponemos a b como entradas
        MOVWF TRISB        
        CLRF TRISC        clareamos c  para ponerlo de salida
        BCF STATUS,RP0        pasamos al banco 0
LEA        MOVF PORTB,0        mueve port b   a w
        MOVWF DIVIDENDO        mueve w a dividendo
        MOVWF DIVISOR        mueve w a divisor
        SWAPF DIVISOR,1         intercambio de nibble queda en el divisor
        BCF DIVIDENDO,04        clarear dividendo
        BCF DIVIDENDO,05        clarear dividendo
        BCF DIVIDENDO,06        clarear dividendo
        BCF DIVIDENDO,07        clarear dividendo
        BCF DIVISOR,04        clarear divisor
        BCF DIVISOR,05        clarear divisor
        BCF DIVISOR,06        clarear divisor
        BCF DIVISOR,07        clarear divisor
        CLRF RESP