Page 1 of 1

Error in lcd display

Posted: Wed Aug 02, 2006 1:50 pm
by ukweb
The following code compiles and runs fine. but on the lcd display it doesn't show right information. it displays up but down is being displayed as dgwf when i press the sa4 button.

So please let me know how to sort it out. thank you ukweb

#include "lcdlib.h"

const unsigned char down [5] = { 'd','o','w','n',0x00 } ;

const unsigned char up [5] = { 'u','p',' ',' ',0x00 } ;

void main ( void )
{
lcd_start () ;

while (1)
{
lcd_cursor ( 0, 0 ) ;

if ( input_port_a() )
{
lcd_print ( down ) ;
}
else
{
lcd_print ( up ) ;
}
}
}

Posted: Thu Aug 03, 2006 10:15 am
by Ian
Have you defined Port A as inputs and Port B as outputs?

Posted: Thu Aug 03, 2006 3:04 pm
by Steve
This is almost certainly an LVP issue. If the chip you are using is in Low Voltage Programming mode, then B3 [assuming you are using a 16F88] cannot be used as a general purpose i/o line.

The LCD display routines (I think) assume you are using B0 to B4 to communicate with the LCD display and because B3 does not work, some of the letters will come out wrong.

To remedy this, make sure that the chip you are using has the configuration word(s) set so that LVP is disabled.