16 x 2 LCD display

I am pretty much a novice with electronics/arduino, but I have managed to write sketches to do various things with LEDs etc.

I recently purchased a 16 x 2 LCD display, but despite lots of head banging I cannot seem to get it to display any text.
The backlight comes on and a potentiometer will control contrast, however only the top line is visible.

The circuit and sketch I used are here
http://earthshinedesign.co.uk/Datasheets/LCD_MODULE_INSTRUCTIONS.pdf

I did add lcd.begin(16, 2); to the setup and also tried with Read/Write select (pin 5) connected to GND.
Any help to point me in the right direction would be appreciated.

Steve.

First things first, check your wiring.

I've gotten very similar results with a LCD that was wired in the wrong order. Also make sure that you have started at pin 11 for the data, ignoring pins 7-10.

Post your code too, maybe your missing something.

Sorry I can't be much more help.

Tahnks for the reply.
I have checked my wiring many time but I will have another go.

#include <LiquidCrystal.h>

// LiquidCrystal display with:
// rs on pin 12
// rw on pin 11
// enable on pin 10
// d4, d5, d6, d7 on pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
void setup()
{
     lcd.begin(16, 2);
// Print a message to the LCD.
     lcd.print("hello, world!");
}
void loop()
{}

// d4, d5, d6, d7 on pins 5, 4, 3, 2

Don't you have to use d0, d1, d2, d3 for four-bit?
[edit]I think the examples LiquidCrystal - Arduino Reference are at odds wth the source:

LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
                       uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
                       uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
{
  init(0, rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7);
}

LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t enable,
                       uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
                       uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
{
  init(0, rs, -1, enable, d0, d1, d2, d3, d4, d5, d6, d7);
}

LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
                       uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)
{
  init(1, rs, rw, enable, d0, d1, d2, d3, 0, 0, 0, 0);
}

LiquidCrystal::LiquidCrystal(uint8_t rs,  uint8_t enable,
                       uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3)
{
  init(1, rs, -1, enable, d0, d1, d2, d3, 0, 0, 0, 0);
}

and with the notes:

If the former, omit the pin numbers for d0 to d3 and leave those lines unconnected.

[/edit]

[edit]Please ignore all my above ravings of an imbecile.[/edit]

No worries :slight_smile:

The top line displays correctly? Maybe you're just inputting too much text. Bare in mind that it doesn't wrap.

Did you try setting the cursor to the second line and then sending something?

Did you modify

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

to

LiquidCrystal lcd(12, 10, 5, 4, 3, 2);

when you wired r/w to ground ?

when you wired r/w to ground ?

Not that it would matter though..

It shouldn't but I'm a great beleiver in not giving stuff the slightest excuse not to work.... :wink:

Taking the R/W out of the equation has cured similar problems in the past.

Pluggy, yes I modified the code when R/W was grounded.

I'm still persevering, sometimes it's more fun when it doesn't work first time :slight_smile:

It shouldn't but I'm a great beleiver in not giving stuff the slightest excuse not to work....

Agreed. Just making sure we're on the same page ;D!

Steve:

however only the top line is visible

I assume that this means you can see rectangular blocks on the top line. This means that you have power to the LCD module and the contrast is roughly correct, but the LCD controller is not properly initialized.

Forget about the example code in the link since it refers to the obsolete 4-bit Library. Use the LiquidCrystal library that comes with Arduino v0017 and cut and paste the example sketch that comes with it as your sketch. Do not use the example code in the playground, it is currently FUBAR. You can change the program code to match your wiring, or vice versa. Don't forget to ground the RW pin (pin 5) if you have not specified a pin for it.

Don

TchnclFl

The top line displays correctly?

I don't think this is what he meant. But if he did then see below.

Maybe you're just inputting too much text. Bare in mind that it doesn't wrap.

You can't input too much text and it does wrap, just not the way you might expect. Check out the LCD Addressing link at http://web.alfredstate.edu/weimandn to see what I mean.

Don

i am hvaing the same problem where only one line of blocks lights up, i'm using this LCD, and none of the libraries/ codes i've used so far have worked... any idea on what to do? should i edit the .cpp files anywhere?

lcd specs:
http://www.topwaydisplay.com/Pub/Manual/LMB162NFC-Manual-Rev0.1.pdf

Don, followed your suggestions and got 2 rows of garbled characters, checked and resoldered the connections and it is working fine.

Thanks you all for the help, it is up and running now.

Evz:

any idea on what to do?

Follow the same suggestions that I gave Steve.

should i edit the .cpp files anywhere?

No.

Don

i tried using the older LiquidCrystal sketch example, but still all my lcd does is power up to a single line of block characters no matter which example sketch i upload, i tried rewiring in every single possibility with no luck :frowning:

Evz:

i tried using the older LiquidCrystal sketch example

People have been having trouble with the older libraries and their examples for years. Arduino v0017 has a reliable library with examples that are written for this library. If you use any combination of old libraries and/or old examples you are doomed to failure - which you have proven.

Here are the steps that I gave previously in Reply #11.

  1. Hook up only the power and contrast pins (and backlight, if equipped). You should be able adjust the potentiometer to get a row of rectangular blocks on the top line of your display. If you don't get the row of blocks than there is no sense in proceeding.

  2. Use the LiquidCrystal library that comes with Arduino v0017 and cut and paste the example sketch that comes with it to use as your sketch. Do not use the example code in the playground, it is currently FUBAR. The 4-bit library and the older versions of LiquidCrystal are not relaible either.

  3. Don't forget to ground the RW pin (pin 5) if you have not specified a pin for it. This is not emphasized enough anywhere.

Don

Ok thank you! finally got it to work! RW to ground, but i think my problem maybe have been totaly due to stupiditiy, i was going to give up when i checked my bread board wiring to see D4 was open was open and i was actually wired to D3 !!!!

:frowning:

Don't you just hate it when the wires don't go where you tell them to?