PDA

View Full Version : Missing chars at beginning of LCD display



jimbostlawrence
- 19th November 2009, 12:04
Hi,

Still a bit of a noob here but getting the hang of things now. I've recently bought a 2x16 and a 4x20 LCD display. Great fun! Finally put a negative couple of volts via a pot' on the display to get the contrast to show the image. However, I seem to have an issue with the larger (4x20) unit. When I first send the command:

LCDOUT $FE,1,"Hello"

It displays this, but, if I then follow it with a pause perhaps, and another command:

LCDOUT $FE,1,"Hello"
PAUSE 500
LCDOUT $FE,1,"World"

It's output is:

Hello
[clear screen]
rld

Help!! Any subsequent info sent to the screen misses the first 2 chars.

I've replaced the LCD with the 2x16 but this works fine. Put the 4x20 LCD back on and the problem returns...

Weird

Any offers? :)

-Jimbo-

jimbostlawrence
- 19th November 2009, 13:15
Fixed it! Read somewhere about 'home' taking time, so I changed the code to:

PAUSE 500 ; wait for LCD to initialise

loop:
LCDOUT $FE,1 ; clear screen and return cursor to top-left
PAUSE 100 ; wait for cursor to be moved to top-left!
LCDOUT "Hello"
PAUSE 500
LCDOUT $FE,1 ; clear screen and return cursor to top-left
PAUSE 100 ; wait for cursor to be moved to top-left!
LCDOUT "World"
PAUSE 500
goto loop


I would think the PAUSE 100 could be significantly reduced, but I'll fiddle with that later. The main thing is, the display is working! [was beginning to wonder!]

Best regards to all, and don't give up on a fault... there's always a solution out there :P

Darrel Taylor
- 19th November 2009, 17:05
Jimbo,

Yes, Clear Screen/Home cursor normally takes 1.6 mS to complete (1600 uS).
That time can be compensated for with the LCD_COMMANDUS define.

PBP 2.50 had a default of 1500 uS, which is too short for most displays.
It was increased in 2.60.

Adding this line should fix it without the pauses.
DEFINE LCD_COMMANDUS 2000

jimbostlawrence
- 20th November 2009, 00:13
Hi Darrel,

Many thanks for your reply/explanation. I'll add that in my routines from now on.

Best regards.

-Jimbo-

P.S. Just implemented the -ve supply from the 232 comm's chip to supply contrast potential as recommended by many, as opposed to using a separate psu ;) Works a treat - whole unit is now running off an old mobile phone charger, through a 7805 dc-dc converter ;)