Porqué no funciona ésto en Proteus ?

Estoy intentando simular éste teclado en Proteus, el problema es que la primera columna no la marca el display.

Aquí os dejo el código y el circuito

Device=16F877A
Declare LCD_Type
=0
Declare LCD_Interface 4
Declare LCD_Lines=2
Declare LCD_DTPin PORTD.4
Declare LCD_RSPin PORTA.1
Declare LCD_RWPin PORTA.2
Declare LCD_ENPin PORTA.3

Low PORTA.2 'Necesario
Xtal=4
All_Digital=true
TRISC=%011111000
Clear PORTC
' creando variables
Dim tecla As Byte
Dim
direccion As Byte
Dim
valor As Byte



Print At
1,1,"PULSA MANUAL O AUTO"
Print At 2,1," * MANUAL # AUTO"
Call TECLADO


inicio:

tecla = 11

Call TECLADO
If tecla=11 Then
GoTo
inicio
Else
Cls
Print At
1,1, #TECLA
If tecla=8 Then Call SELECT_TEMP




EndIf

GoTo
inicio
TECLADO:

PORTC.0 = 0 'COLUMNA 1=0
PORTC.1 = 1 'COLUMNA 2=1
PORTC.2 = 1 'COLUNMA 3=1

If PORTC.3 = 1 Then tecla = 1 'TECLA 1

If PORTC.4 = 1 Then tecla = 4 'TECLA 4
If PORTC.5 = 1 Then tecla = 7 'TECLA 7
If PORTC.6 = 1 Then tecla = 10 'TECLA *

PORTC.0 = 1 'COLUMNA 1=1
PORTC.1 = 0 'COLUMNA 2=0
PORTC.2 = 1 'COLUNMA 3=1

If PORTC.3 = 1 Then tecla = 2 'TECLA 2
If PORTC.4 = 1 Then tecla = 5 'TECLA 5
If PORTC.5 = 1 Then tecla = 8 'TECLA 8
If PORTC.6 = 1 Then tecla = 0 'TECLA 0

PORTC.0 = 1 'COLUMNA 1=1
PORTC.1 = 1 'COLUMNA 2=1
PORTC.2 = 0 'COLUNMA 3=0

If PORTC.3 = 1 Then tecla = 3 'TECLA 3
If PORTC.4 = 1 Then tecla = 6 'TECLA 6
If PORTC.5 = 1 Then tecla = 9 'TECLA 9
If PORTC.6 = 1 Then tecla = 12 'TECLA #
'DelayMS 150 en proteus me da problemas



Return 'RETORNA UNA LINEA DESPUES DEL LLAMADO CALL

'------------------- SUBRUTINA PARA GUIARDAR EL VALOR DEL PULSADOR EN MEMORIA --------------




SELECT_TEMP:
Cls
Print At
1,1,"Temp Max de Preheat?"
Print At 2,11,"Enter #"
Return

 

Adjuntos

  • teclado.rar
    13.2 KB · Visitas: 15
Tenes que adjuntar tambièn el archivo teclado_1.bas, como lo tenés, para que no haya errores.
PD: en realidad tenes que adjuntar todo el proyecto para poder simularlo.

Tenes dos cosas mal. El codigo y el esquema. En el adjunto van las dos cosas arregladas.
Saludos.
 

Adjuntos

  • teclado.ZIP
    14.3 KB · Visitas: 19
Última edición:
Atrás
Arriba