Problem with connecting an LCD 16x2

As title, i have a problem to connect an LCD 16x2 ( JHD162A ) to my Arduino Diecimila. I've used this guide for connection Arduino Tutorial - connecting a parallel LCD. When i power up my lcd seems to work all, i can change contrast with potentiometer, backlight work and logic(second line black squares) work too. But when i upload "HelloWorld" sketch( and update line LiquidCrystal lcd(7, 8, 9, 10, 11, 12); ) LCD don't print nothing, i've tryed different sketchs but still does not work. I've checked connection and seems all to be right. Where can be the problem?

Here i've found datasheets:

Connections are the same in the guide.

Look at this line :

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

LiquidCrystal(rs, enable, d4, d5, d6, d7);

Did you connect the pins at the right place ? example : pin 7 to rs, pin 8 to enable, etc

The link is a standard LCD display. The LCD library should work. It work with me. I have IDE 022. And I have different LCD displays too, but the pins out are standard LCD display. As long the pins correspond to the pins inside the function, and the code is correct, it should work.

Dont forget the PoT ,, or you wont see a thing :slight_smile:

Techone:
Look at this line :

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

LiquidCrystal(rs, enable, d4, d5, d6, d7);

Did you connect the pins at the right place ? example : pin 7 to rs, pin 8 to enable, etc

The link is a standard LCD display. The LCD library should work. It work with me. I have IDE 022. And I have different LCD displays too, but the pins out are standard LCD display. As long the pins correspond to the pins inside the function, and the code is correct, it should work.

I've connected pins from 7 to 12 to lcd like in the guide, so yes. I need to add line LiquidCrystal(rs, enable, d4, d5, d6, d7); too?

woody_unreal:
Dont forget the PoT ,, or you wont see a thing :slight_smile:

As i said, i have connected pot and power, and seems all working, i can change contrast with pot.

When i start arduino, lcd seems inizialize(for 1 sec the second row have black squares, after they disappear and lcd don't print nothing).

i've tryed different sketchs but still does not work.

Perhaps if you posted the sketch that didn't work we could help.

Do not post a link to the sketch that you think you used, we need a copy/paste version of the sketch that you actually used.

Don

Here:

/*
  LiquidCrystal Library - Hello World
 
 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the 
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.
 
 This sketch prints "Hello World!" to the LCD
 and shows the time.
 
  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 
 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe
 
 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}

Lets get rid of all of the irrelevant stuff and the changing data and see what happens.

Try the following sketch. It doesn't matter which Arduino pins you use, just make sure that the pins in the LiquidCrystal lcd() comment match up with the numbers in the actual LiquidCrystal lcd() statement.

#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup()
  {
  lcd.begin(16, 2);
  lcd.print("hello, world!");
  lcd.setCursor(0,1)
  lcd.print("it works!");
  }

void loop()
  {
  }

Be aware that if you initially have blocks on the second row of your display then you will have to stand on your head to read the text.

Don

Doesn't work, tomorrow i will post photo of connections, lcd backgroud and a video of what i see.

May be the voltage too high? i've connected all vcc to arduino +5V(and a 10k pot to contrast). On datasheet i've found that:

6.ELECTRICAL SPECIFICATIONS(Ta=250C,Vdd=5.0V)
Item Symbol Condition Standard Value
Min Type Max
Unit
Supply Voltage for logic Vdd-GND - 4.5 5.0 5.5 V
Supply Current for logic Idd - 1.0 - mA
Driving Current for LCD Iee - 0.6 - mA
Driving Voltage for LCD Vdd-V5 4.2 4.5 4.8 V
Input Voltage H level Vih 2.2 - Vdd V
Input Voltage L level Vil
Vdd=5V
-0.3 - 0.6 V
Output Voltage H Voh Ioh=-0.205mA 2.4 - - V
Output Voltage L Vol Io1=1.2mA - - 0.4 V

Here some photo:

And here two video:

First it's what i see when i power arduino and lcd:

http://www.videoweed.es/file/ald2kx5v8kxzm

Second it's what i see when is powered and i adjust contrast with pot:

http://www.videoweed.es/file/26p3ums5on0yx

Sketch is "HelloWorld" with pins changed.
I've cheked again all pins with an ohmeter from lcd directly to arduino pins, connections work and i don't have any short-circuit.

After you load the sketch hit the reset button and see what happens. On my Uno (r2) if I have any of the lcd pins hooked up to either pin 3 or 7 then it will not run. It will work if I move to any of the other pins. The new Uno(r3) has fixed this by building a better reset circuit.

Your photographs are not very helpful because there is no single picture where I can trace the wires between your Arduino and your LCD module.

I do not trust those video download links so I have not seen the videos.

From what I can see in the '9gvimd' picture you have not interpreted the pins correctly. Pin 1 is near the outside edge of the PC board and pin 16 is near the center.

Don

tin solder is notorious bad with these row headers.

Do you have any other display?

Have you tried to use it in 8bit mode + measured all signals directly on the LCD (if anything arrives at all)?

Have you tried to use it in 8bit mode + measured all signals directly on the LCD (if anything arrives at all)?

It doesn't matter what mode he uses it in and what signals are sent to the data pins if he doesn't provide power to the IC controller via pins 1 and 2.

Don

floresta:
Your photographs are not very helpful because there is no single picture where I can trace the wires between your Arduino and your LCD module.

I do not trust those video download links so I have not seen the videos.

From what I can see in the '9gvimd' picture you have not interpreted the pins correctly. Pin 1 is near the outside edge of the PC board and pin 16 is near the center.

Don

Sorry, i thought they were more understandable, i will try to do better photos.

As you see in the photo '2vdqwj9' i've powered pin 1-2 with two wire above the board, external are gnd and internal are +5 volt, the third pin from right is for contrast(pin3), next are rs(pin4), mass(pin5), enable(pin6), 4 unused pin(pin7-10), and db4(pin11), db5(pin12), db6(pin13), db7(pin14), they go to arduino in, rs (arduino pin 7 ), e (arduino pin 8 ), from arduino pin 9-12 are db4-db7. If i had not power them i shouldn't see "black" squares when i power arduino.

Videos are uploaded on videoweed, it's a streaming video site, just click on bottom left 'symbol play' in the video window, not in center like youtube. If you want i can upload it on another site that you tell me.

takao21106:
tin solder is notorious bad with these row headers.

Do you have any other display?

Have you tried to use it in 8bit mode + measured all signals directly on the LCD (if anything arrives at all)?

I don't have any other displays, and as i said i check all wires form lcd to arduino with an ohmeter, so signal should arrive.

justone:
After you load the sketch hit the reset button and see what happens. On my Uno (r2) if I have any of the lcd pins hooked up to either pin 3 or 7 then it will not run. It will work if I move to any of the other pins. The new Uno(r3) has fixed this by building a better reset circuit.

Nothing, i can try to move pin 7 to pin 6, i'll say you what happen. But i don't think this is the problem, because in the guide he use an arduino duemilanove, and i've an arduino diecimila.

I'm going angry with this lcd.

The single row of blocks means that your LCD controller is not being initialized properly. This is almost always due to incorrect or defective connections.
By the way, your display is still upside down - but you will discover this when you get it working.

mass(pin5),

What does this mean? Pin 5 must be connected to GND (pin 1).

Don

Well I meant if you checked the signals using LEDs or logic analyzer.

I use LEDs + 4.7k, tag them to ICs or displays using just a little solder.

Maybe you can slow down the software, and then you can see specific flashes,
otherwise also they should be observeable to light up for an instant.

I often had trouble with PIC ICSP in past years, or tristate/alternate pheripherals,
tagging LEDs cleared that up.

floresta:
The single row of blocks means that your LCD controller is not being initialized properly. This is almost always due to incorrect or defective connections.
By the way, your display is still upside down - but you will discover this when you get it working.

mass(pin5),

What does this mean? Pin 5 must be connected to GND (pin 1).

Don

Sorry, i meant GND. But i've see on the guide the same initialization with a single row of 'black' blocks.

takao21106:
Well I meant if you checked the signals using LEDs or logic analyzer.

I use LEDs + 4.7k, tag them to ICs or displays using just a little solder.

Maybe you can slow down the software, and then you can see specific flashes,
otherwise also they should be observeable to light up for an instant.

I often had trouble with PIC ICSP in past years, or tristate/alternate pheripherals,
tagging LEDs cleared that up.

You have connected a resistance of 4.7k between vcc and +LEDs pin?
Can you explain me how i can slow software? I need to change parameters in the liquidcrystal library?

Sorry, i meant GND. But i've see on the guide the same initialization with a single row of 'black' blocks.

That's before the initialization. It's before the Arduino is even connected to the LCD module.

You have connected a resistance of 4.7k between vcc and +LEDs pin?
Can you explain me how i can slow software? I need to change parameters in the liquidcrystal library?

Don't waste your time by tinkering with the software. You most likely have an improper connection.

Your photographs are not very helpful because there is no single picture where I can trace the wires between your Arduino and your LCD module.

How about dealing with this problem?

Don

floresta:

Your photographs are not very helpful because there is no single picture where I can trace the wires between your Arduino and your LCD module.

How about dealing with this problem?

Don

Tomorrow i'll take better pictures and i'll upload it. And if i'll find a breadboard i'll try to rewire all.

Ty for your help.