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
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