AQUI EL PROGRAMITA DEL MINUTERO
'****************************************************************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2010 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 18/06/2010 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
@ DEVICE pic16F628A, INTRC_OSC_NOCLKOUT ' Opción del Osc Interno
Define osc 4
@ DEVICE pic16F628A, WDT_ON ' Watchdog Timer ON
@ DEVICE pic16F628A, PWRT_ON ' Power-On Timer
@ DEVICE pic16F628A, BOD_ON
@ DEVICE pic16F628A, MCLR_OFF ' Master Clear Opción interno
@ DEVICE pic16F628A, LVP_OFF ' Bajo voltaje de programación
@ DEVICE pic16F628A, CPD_OFF ' Protección del código de memoria OFF
@ DEVICE pic16F628A, PROTECT_OFF ' protección de código OFF
CMCON = 7
pause 500'TIEMPO DE ESPERA 1/2 SEG. PARA ESTABILIZAR EL PIC
MAS VAR PORTA.0
MENOS VAR PORTA.1
ENTER VAR PORTA.2
A VAR BYTE
B VAR BYTE
MINUTOS VAR BYTE
SEGUNDOS VAR BYTE
A = 0
B = 0
MINUTOS = 0
SEGUNDOS = 0
'DEFINICIÓN DE REGISTROS PARA EL LCD
DEFINE LCD_DREG PORTB 'UTILIZAR 4 BITS DEL PUERTO B PARA TX DE DATOS
DEFINE LCD_DBIT 4 'DESDE EL BIT B.4 AL BIT B.7
DEFINE LCD_RSREG PORTB'UTILIZAR EL REGISTRO DE CONTROL/DATOS EN EL PUERTO B
DEFINE LCD_RSBIT 1 'EN EL BIT B.1
DEFINE LCD_EREG PORTB 'UTILIZAR EL ENABLE EN EL PUERTO B
DEFINE LCD_EBIT 2 'EN EL BIT B.2
TRISA = %00000111
TRISB=0 'ESTABLECER EL PUERTO B COMO SALIDA
PORTB.6 = 1
PAUSE 500 ' PAUSE DE MEDIO SEGUNDO
LCDOUT $FE, 1 ' LIMPIAR VISOR
LCDOUT 254, 64, $15,$15,$15,$15,$15,$15,$15,$0 '0 lineas verticales
LCDOUT 254, 72, $1F,$0,$1F,$0,$1F,$0,$1F,$0 '1 lineas horizontales
LCDOUT 254, 80, $E,$1F,$1F,$1F,$1F,$1F,$E,$0 '2 circulo negro
LCDOUT 254, 88, $E,$11,$11,$11,$11,$11,$E,$0 ' 3 circulo blanco
LCDOUT 254, 96, $1F,$15,$1F,$15,$1F,$15,$1F,$0 '4 lineas verticales
LCDOUT $FE, 1 ' LIMPIAR LCD
'*******************************************************************************
GOSUB INICIO
INICIO:
LCDOUT $FE,$84, "IUNP"
LCDOUT $FE,$80,0
pause 50
LCDOUT $FE,$C0,4
pause 50
LCDOUT $FE,$81,2
pause 50
LCDOUT $FE,$82,3
pause 50
LCDOUT $FE,$C1,1
pause 50
LCDOUT $FE,$C2,1
pause 50
LCDOUT $FE,$C3,1
pause 50
LCDOUT $FE,$C4,1
pause 50
LCDOUT $FE,$C5,1
pause 50
LCDOUT $FE,$C6,1
pause 50
LCDOUT $FE,$C7,1
pause 50
LCDOUT $FE,$C8,1
pause 50
LCDOUT $FE,$C9,1
PAUSE 2000
'MOSTRAR LETRA POR LETRA
GOSUB PRESENTACION
Procesando:
LCDOUT $FE, 1 ' LIMPIAR LCD
For A = 0 to 15
LOOKUP A,[ "POR FAVOR ESPERE" ],B
LCDOUT $FE,$0C,B
GOSUB PAUSA_12SEG
NEXT
LCDOUT $FE,$C0, "CARGANDO"
For A = 0 to 15
LOOKUP A,[ "......." ],B
LCDOUT $FE,$0C,B
GOSUB PAUSA_12SEG
NEXT
PANTALLA_PRINCIPAL:
LCDOUT 254, 64, 0, 0, 0, 4, 0, 0, 0, 0
LCDOUT 254, 72, 0, 0, 4, 14, 4, 0, 0, 0
LCDOUT 254, 80, 0, 0, 14, 14, 14, 0, 0, 0
LCDOUT 254, 88, 0, 4, 14, 31, 14, 4, 0, 0
LCDOUT 254, 96, 0, 21, 14, 31, 14, 21, 0, 0
LCDOUT 254, 104, 0, 4, 14, 31, 14, 4, 0, 0
LCDOUT 254, 112, 0, 0, 14, 14, 14, 0, 0, 0
LCDOUT 254, 120, 0, 0, 4, 14, 4, 0, 0, 0
LCDOUT 254, 128, 0, 0, 4, 14, 4, 0, 0, 0
LCDOUT $FE, 1 ' LIMPIAR LCD
LCDOUT $FE,1, " PONER MINUTOS"
LCDOUT $FE,$8F, 0
PAUSE 50
LCDOUT $FE,$8F, 1
PAUSE 50
LCDOUT $FE,$8F, 2
PAUSE 50
LCDOUT $FE,$8F, 3
PAUSE 50
LCDOUT $FE,$8F, 4
PAUSE 50
LCDOUT $FE,$8F, 5
PAUSE 50
LCDOUT $FE,$8F, 6
PAUSE 50
LCDOUT $FE,$8F, 7
PAUSE 50
LCDOUT $FE,$8F, 8
PAUSE 50
LCDOUT $FE,$C0, "-<<", dec (MINUTOS),">>+ INICIAR"
PAUSE 250
IF MAS OR MENOS = 1 THEN
GOSUB TECLAS_DE_SELECCION
ENDIF
IF ENTER = 1 THEN
SEGUNDOS = 60
MINUTOS = MINUTOS - 1
GOSUB CONTEO
ELSE
GOSUB PANTALLA_PRINCIPAL
ENDIF
TECLAS_DE_SELECCION:
IF MAS = 1 AND MINUTOS = 99 THEN
MINUTOS = 0
ENDIF
IF MENOS = 1 AND MINUTOS = 0 THEN
MINUTOS = 100
ENDIF
IF MAS = 1 THEN
MINUTOS = MINUTOS + 1
ENDIF
IF MENOS = 1 THEN
MINUTOS = MINUTOS - 1
ENDIF
GOSUB PANTALLA_PRINCIPAL
PRESENTACION:
LCDOUT $FE, 1 ' LIMPIAR LCD
For A = 0 to 13
LOOKUP A,[ " BIENVENIDO " ],B
LCDOUT $FE,$0C,B
GOSUB PAUSA_12SEG
NEXT
LCDOUT $FE, $C0
For A = 0 to 14
LOOKUP A,[ " MINUTERO V1.0 " ],B
LCDOUT $FE,$0C,B
GOSUB PAUSA_12SEG
NEXT
LCDOUT $FE, 1 ' LIMPIAR LCD
For A = 0 to 11
LOOKUP A,[ " DERECHOS " ],B
LCDOUT $FE,$0C,B
GOSUB PAUSA_12SEG
NEXT
LCDOUT $FE, $C0
For A = 0 to 12
LOOKUP A,[ " RESERVADOS " ],B
LCDOUT $FE,$0C,B
GOSUB PAUSA_12SEG
NEXT
LCDOUT $FE, 1 ' LIMPIAR LCD
For A = 0 to 14
LOOKUP A,[ " REALIZADO POR: " ],B
LCDOUT $FE,$0C,B
GOSUB PAUSA_12SEG
NEXT
LCDOUT $FE, $C0
For A = 0 to 15
LOOKUP A,[ "REIMY VILLAMIZAR" ],B
LCDOUT $FE,$0C,B
GOSUB PAUSA_12SEG
NEXT
LCDOUT $FE, 1 ' LIMPIAR LCD
For A = 0 to 15
LOOKUP A,[ " I . U . N . P . " ],B
LCDOUT $FE,$0C,B
GOSUB PAUSA_12SEG
NEXT
LCDOUT $FE, $C0
For A = 0 to 12
LOOKUP A,[ " 09/08/2010 " ],B
LCDOUT $FE,$0C,B
GOSUB PAUSA_12SEG
NEXT
RETURN
CONTEO:
LCDOUT $FE, 1 ' LIMPIAR LCD
LCDOUT $FE,1, " TEMPORIZANDO "
LCDOUT $FE,$C0,"----",dec(MINUTOS),":",dec(segundos),"-PARAR-"
SEGUNDOS = SEGUNDOS - 1
GOSUB PAUSA_11SEG
IF MINUTOS = 0 AND SEGUNDOS = 0 THEN
LCDOUT $FE, 1 ' LIMPIAR LCD
LCDOUT $FE,1, " FINALIZADO "
LCDOUT $FE,$C0,"----",dec(MINUTOS),":",dec(segundos),"-PARAR-"
PORTA.3 = 1
GOSUB PAUSA_11SEG
PORTA.3 = 0
PORTA.3 = 1
GOSUB PAUSA_11SEG
PORTA.3 = 0
PORTA.3 = 1
GOSUB PAUSA_11SEG
PORTA.3 = 0
PORTA.3 = 1
GOSUB PAUSA_11SEG
PORTA.3 = 0
PORTA.3 = 1
GOSUB PAUSA_11SEG
PORTA.3 = 0
GOSUB Procesando
ENDIF
IF SEGUNDOS = 0 THEN
GOSUB PAUSA_11SEG
MINUTOS = MINUTOS - 1
SEGUNDOS = 59
CALL PARAR
GOSUB CONTEO
ENDIF
PARAR:
IF MENOS = 1 THEN
GOTO Procesando
ELSE
GOTO CONTEO
ENDIF
END
PAUSA_11SEG:
PAUSE 1000
RETURN
PAUSA_12SEG:
PAUSE 200
RETURN