TODOPIC
Simuladores, editores de PCB, etc => Simuladores de circuitos => Proteus ISIS => Mensaje iniciado por: tekag en 25 de Abril de 2005, 14:16:00
-
Hola amigos!
Intento simular un LCD con un programa en PICBASIC y no aparece el texto que le puse en la pantalla del LCD.SI lo hago en C si.
Aca les pongo el codigo ya que no se si me falta inicializarlo o no:
" he conectado el LCD como lo indica la pagina 43 del manual PICBASIC PRO:
"
" LCD PIC
" D7 A3
" D6 A2
" D5 A1
" D4 A0
" Enable B3
" RW masa
" RS A4
" Setea el bit de comienzo de datos (0 o 4) si el bus es de 4-bit
DEFINE LCD_DBIT 0
" Setea el port LCD Register Select
DEFINE LCD_RSREG PORTB
" Setea el bit LCD Register Select
DEFINE LCD_RSBIT 4
" Setea el port LCD Enable
DEFINE LCD_EREG PORTB
" Setea el bit LCD Enable
DEFINE LCD_EBIT 5
" Setea el tamaño del bus LCD (4 o 8 bits)
DEFINE LCD_BITS 4
" Setea el numero de lineas en el LCD
DEFINE LCD_LINES 2
TRISB = %00000010
pause 500
lcdout $FE,1,"temperatura:"
Cuando lo cargo este programita en el Proteus no funciona.La iniclializacion esta bien hecha o me falta algo?
Saludos
-
Hola, Yo he usado este compilador, ya que me parece uno sencillo y facil
y no he tenido ningun Problema,
Segun el Manual
DEFINE LCD_DREG PORTB ‘ Setea el port de datos LCD
DEFINE LCD_DBIT 0 ‘ Setea el bit de comienzo de datos (0 o 4) si el bus es de 4-bit
DEFINE LCD_RSREG PORTB ‘ Setea el port LCD Register Select
DEFINE LCD_RSBIT 4 ‘ Setea el bit LCD Register Select
DEFINE LCD_EREG PORTB ‘ Setea el port LCD Enable
DEFINE LCD_EBIT 5 ‘ Setea el bit LCD Enable
DEFINE LCD_BITS 4 ‘ Setea el tamaño del bus LCD (4 o 8 bits)
DEFINE LCD_LINES 2 ‘ Setea el numero de lineas en el LCD
AHORA, tu me dices que has conectado los pines de Datos=RA0-RA3 RS=PORTB.3 EN=PORTA.4
Ahora si dices que has conectado Enable al PORTB.3, entonces debe ser
DEFINE LCD_EREG PORTB ‘ Setea el port LCD Enable
DEFINE LCD_EBIT 3 ‘ Setea el bit LCD Enable como el Tercero
y lo mismo para el RS que esta en PORTA.4, deberia ser
DEFINE LCD_RSREG PORTA ‘ Setea el port LCD Register Select
DEFINE LCD_RSBIT 4 ‘ Setea el bit LCD Register Select
Entonces el codigo Correcto debe ser
"***************************************************************
"***************************************************************
"***************************************************************
DEFINE LCD_DREG PORTB ‘ Setea el port de datos LCD
DEFINE LCD_DBIT 0 ‘ Setea el bit de comienzo de datos (0 o 4) si el bus es de 4-bit
DEFINE LCD_RSREG PORTA ‘ Setea el port LCD Register Select
DEFINE LCD_RSBIT 4 ‘ Setea el bit LCD Register Select
DEFINE LCD_EREG PORTB ‘ Setea el port LCD Enable
DEFINE LCD_EBIT 3 ‘ Setea el bit LCD Enable
DEFINE LCD_BITS 4 ‘ Setea el tamaño del bus LCD (4 o 8 bits)
DEFINE LCD_LINES 2 ‘ Setea el numero de lineas en el LCD
PAUSE 500
LCDOUT $FE,1,"temperatura:"
"***************************************************************
"***************************************************************
"***************************************************************
Ahora, no es necesario que configures al TRISB, que el programa lo hace
Espero haberte ayudado.
y no tew molestes tanto que la gente para un tanto ocupada tambien
Yoel Ocmin
http://proyectosfie.tk