Trouble with 2x12 LCD

Hello,

I've been fighting with this:

for a few hours tonight. I have it wired up so that the top line of the LCD shows up with all the pixels lit, and I have the potentiometer setup to control the contrast. My big problem is getting the display to do anything.

I've been following the LCD tutorial and think I have all the pins hooked up correctly but clearly I'm doing something wrong...

From what I can tell from the datasheet there are three pins that need to be hooked up to display labelled: 'RS' 'R/W' and 'E' - and then the 8 data pins.

I want to hook up the display in 4bit mode because I'm just learning and the soldering pitch on this display is a challenge for me. So I hooked up the DB4 -7 pins to the arduino. The control wires are where I'm really confused. The tutorial I'm looking at has good overlap for the 'RS' pin, but it doesn't tell me what to do with the 'RW' or 'E' pin... Any help on clearing up the functions of these pins is much appreciated... That is, which of these should be hooked to a digital pin? Should both?

Also, is the difference between 4bit and 8bit the difference between 1 and 2 lines in the display?

Thanks in advance!

I think R/W should be connected to ground an E to +5V.

The difference between 4 and 8 bit mode has nothing to do with how much you can display, it just defines how many bits you send to the display at a time. So 4 bit mode sends 4 bits 2 times to send a byte to the display, 8 bit mode sends a full byte in one go. The reason to use 4 bit mode is that you save Arduino pins. Theoretically 4 bit mode i slower but for almost all practical uses it doesent matter.

Do you use the LCD library in Arduino ?

Hooking up a LCD works fine with just 6 arduino pins. 4 data, E and RS. As been mentioned tie R/W to ground, its very unlikely you'll want to read the display. Use the standard LiquidCrystal library. Use a 10k pot for the contrast, higher value ones can cause problems.

This is where I started :

http://www.skpang.co.uk/content/view/29/42/

It uses the old 4bit library, but the same circuit works fine with the standard Library. Using a pin header soldered to the LCD and plugging it into a breadboard is highly recommended to get it going in the first place. Makes changing connections very easy.

If you have issues and you think your display is connected up properly then check the data lines. Often they get put in the wrong order (my main issue when playing with LCDs!)

Mowcius

MikMo:

I think R/W should be connected to ground an E to +5V.

Assuming you meant:
"I think R/W should be connected to ground and E to +5V.

My question is - did you ever get one to work with E connected to +5v? If so then you would be the first.

Don

archaeo:

First I will respond to your original post:

I have it wired up so that the top line of the LCD shows up with all the pixels lit

This means that the power is connected correctly but the display is not being initialized. This could be a programming error or a wiring error. The most likely wiring error is not grounding the R/W line (pin 5). This was not emphasized in the old tutorial but the tutorial has recently been updated.

I've been following the LCD tutorial

The tutorial was updated in the last week or so.

From what I can tell from the datasheet there are three pins that need to be hooked up to display labelled: 'RS' 'R/W' and 'E' - and then the 8 data pins.

That's for the basic configuration. You can ground the R/W pin and drop 4 of the data pins with the current LiquidCrystal library. That leaves the other 4 data pins, RS, and E.

That is, which of these should be hooked to a digital pin? Should both?

You must connect the four data lines and both RS and E, R/W can be grounded.

Also, is the difference between 4bit and 8bit the difference between 1 and 2 lines in the display?

There is no correlation. Virtually all displays (including those with only one row of characters) are 2 line displays. The term 'line' refers to the internal memory in the LCD controller, not to the number of rows on the display. The 4-bit configuration can do everything the 8-bit configuration can do. The programming is more complex, but the library author has already done that part.

Now I recommend that you look at the tutorial at http://arduino.cc/en/Tutorial/LiquidCrystal. Connect your display just like the pictures show and cut and paste the code into your Arduino v0018 window. If you do all this correctly your device should work.

Don

Thanks to everyone and your helpful replies!

I got up this morning, disconnected everything and then put it all back according to the way you all described it.

As it turns out I was missing two things, one the E pin to ground, and the contrast was turned waaay up so I couldn't tell that there were supposed to be words...

I hooked up my 10k thermistor and have been playing with my new thermometer for a while now!

Thanks again!!!