Can't bring my LCD to live

02 Dec 2010

Hi All,

I have just bought a mbed, and made my first programs..

But now I'm trying to make my LCD 16x2 to work,

I have tried a number of different libraries, but can't make it show anything, so I'm starting to think that my LCD not is compatible ?

Can any of you take a look at the specs and see if it might come to work ?

SPECS

02 Dec 2010

Looking at the data sheet you provided in the link, this LCD requires 5v to operate. If you followed the TextLCD examples in the cookbook, you may have wired it up to 3.3v instead of 5v. I made that mistake when I first followed the directions posted.

02 Dec 2010

Hey Jamie,

Thanx, yes i noted it, and also tried it... but I tried so many things, that I will go back and retry it once more :-)

03 Dec 2010

Hey Nicolai,

maybe it's the timing. the library TextLCD use 40us for the enable pulse. According your spec. you wil be needed 42us or 46us. It's in the table "Controle and display commands" in the data sheet. I have got this problem also for an Optrex LCD but even worse, by trail and error I discover that the enable has to be at least 75us and 3ms for a cls command instead of 1.64ms. So I changed the TextLCD library on those points and called it OptrexLCD and now everything works well for me. You can find on the site and try it, probally it doesn't matter if the enable pulse is longer then necescery.

greet Eduard

03 Dec 2010

Hey Eduard and Jamie.

I have made sure that it uses 5v.

I have made a copy of the TextLCD files, and are trying to go true all the code to see if i can make it work. hmm..are wondering if I just shut have ordered the right LCD Display ;-)

03 Dec 2010

Nicolai: Skal du bruge nogle? Jeg kan få dem billigt/gratis gennem arbejdet.
In english: Nicolai, do you need some? I have get them cheap/free through work.

Sorry to also post in danish, but it's always nice to see a compatriot in here ;-)

Regards,
Lerche

03 Dec 2010

Christian: Hey godt at se en anden Dansker herinde ;-)

Well as it properly shows, I'm all new to this... I have a background in programming but very little electronics knowledge.

I have decided to build a simple robot with my kids as a Christmas project. Currently I’m in the process of making my parts of the robot work, but I’m stuck at this LCD display.

I have tried to inc all the wait’s with at least 10 times, but still my LCD it totally dead.

03 Dec 2010 . Edited: 03 Dec 2010
user Nicolai Iversen wrote:
I have tried to inc all the wait’s with at least 10 times, but still my LCD it totally dead.

Maybe you have a problem with the contrast.

You could try to connect VO direct to GND or use a Contrast Potentiometer of about 20k.

03 Dec 2010

YES... It seems that the 1k resistor from the Cookbook was way to high, with 500Ohms i got some live, but now all i got is one complete line of black squares, and it seems independent of the text I’m printing…wondering if the resistor now is to low… will throw a pot on it and test again.

04 Dec 2010

hmmm....I insted of connecting to d0.d3 I used d4..d7 and now it works.. ?? Great but don't like I don't know why... :-/ I will try to reduce the wait's and see if a can make it work with the original values...

04 Dec 2010

Been there :)

It's simple, really. When using an LCD in 4-Bit-bus-mode pins d4-7 are the ones that are used, that's just how it is :) 

The only problem is that in the demo files' comments it is said differently:

#include "mbed.h"
#include "TextLCD.h"

TextLCD lcd(p24, p25, p26, p27, p28, p29, p30); // rs, e, d0-d3

int main() {     lcd.printf("Hello World!\n"); }

In the discussion concerning LCDs this is explained somewhere, b.t.w.

There's another discrepancy, due to various versions of library I suppose: some use r/w actively (which is necessary if You want to use the display's 'reafy flag'). Others don't.

The example above uses seven pins but in the comment it speaks of six (if You add up ;) ), in the comment it should be rs, rw, e, d4-d7

Christoph

 

04 Dec 2010

Hi Christoph,

He..ok so I'm not the only one ;-)

The include I'm using only uses 6 pins, the RW is just held to GND... but now it works perfectly, also with the original timings...

So a big thanx tou you all :-)

04 Dec 2010

Hi Nicolai,

Great to see you've tracked down the problems and got it working. Based on your notes, I've updated the TextLCD library and examples to use d4-d7 to make it more inline with the datasheets for these LCDs, so hopefully that'll make things more clear in the future. If you have any other tips or insights based on getting that display working, and perhaps a reference for people using that particular display in the future, please feel free to add them to the cookbook page.

Simon

04 Dec 2010

Nicolai, It's good to read that everything works well.