Pages: [1] 2   Go Down
Author Topic:  Problem: Arduino & LCD with KS0066 / SPLC780  (Read 7065 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Folks!
Hope you can help me! I've got a Problem with my LCD 20 x4 Display. I wired it up as explained on the adafruit website ( http://www.ladyada.net/learn/lcd/charlcd.html)
But it doesn't work. The Backlight and the "Blocks" are visible, but I don't get any message to the LCD. I already tried some othere libraries like the LCD4Bit but it didn't wor either. I now found out, that the display hasn't the HD44780 Chip but an other which is almost the same. I found the data sheet here:
http://www.yaoyu-lcm.com/english/admin/Software/20086171462569145.pdf

Could you please help me to fix this problem?

(sorry for my bad english, I quit school some years ago smiley-grin)

greetings kuhni
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You should have had two rows of blocks on a 20x4 display.

I hope you didn't miss this line - it's several lines below the photo of the 'blocks', just above the next photo.  "As mentioned, we'll not be using the RW pin, so we can tie it go ground. That's pin 5 as shown bere:"   Connecting this pin to GND is not optional as the word 'can' implies, it is necessary.

If that is not the problem then we will need a cut/paste copy of the actual code you are using along (not a link to the code that you think you are using) with a photo that clearly shows the LCD <--> Arduino connections.  Forget about LCD4bit.

Don
« Last Edit: December 23, 2010, 10:27:22 am by floresta » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the code I used. The Hello World example. I only changed the 16, 2 to 20, 4 .

Code:
/*
  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
 * 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 8 Feb 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(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);
  // 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);
}

Setup is exactly the same as mentionned in the code explanation:
RS to 12
E to 11
D4 to 5
D5 to 4 ...

I see two blocks with one empty line between. Don't tell me about the wireing of 5v and GND, the pins are switched (see the link of the datasheet, I posted before)

http://www.flickr.com/photos/kuhnikuehnst/5285334675/

Here you can see pictures I made from the Arduino wireing. Hope you can help me!  :'(

greetings Kuhni
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Don't tell me about the wireing of 5v and GND, the pins are switched (see the link of the datasheet, I posted before)
This part does have me confused.  Your LCD controller obviously has the correct power applied otherwise you would see smoke instead of blocks.  Your backlight also appears to be on.  According to your datasheet pin 1 is the ground (-) for the LCD controller and pin 2 is VDD.  This is the normal connection (there are some modules where these are reversed) and you wiring looks correct.  Your datasheet also says that pin 15 is the backlight positive terminal, but you have it connected to GND.  Similarly the datasheet says that pin 16 is the backlight negative terminal, but you have it connected to +5V.

I am assuming that you can vary the intensity of the blocks from very dark to very light which would verify that pin 1 is near the outside edge of the board which is the normal configuration.  What happens if you disconnect one of the green backlight wires?

I cannot follow the four data lines in your photo.  Try using different color wire or spread them apart so they can be followed.  

Are you sure your sketch is being downloaded properly.  You could add some steps to turn the LED at pin 13 ON at the end of setup to check this out.

Don
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What happens if you disconnect one of the green backlight wires?
The backlight turns off  smiley-wink.

Now I changed the wires so everybody will be able to follow them smiley-grin
http://www.flickr.com/photos/kuhnikuehnst/5285644831/

I also added a "blink code" to verify the correct uploading--> it works! (the LED! not the LCD smiley-sad )

Here's the new code:

Code:
/*
  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
 * 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 8 Feb 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(12, 11, 5, 4, 3, 2);

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

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

[edit]I found the Datasheet in the net. On the back of the LCD there is the "Code": YM2004A, so I searched for this code and found the Datasheet i posted in the link.[/edit]
« Last Edit: December 23, 2010, 01:56:19 pm by 92888488 » Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Now I changed the wires so everybody will be able to follow them
Maybe everybody except me.  

I've had problems similar to this one where everything seemed to be connected properly using known good code and still the device didn't work.  I tracked it down to a poor connection on the solderless breadboard.  I suggest that you pull all the wires out and start again using a different part of the breadboard.  While you are at it you can reassign the pins, as Lady Ada did, so the LCD wires align nicely with the Arduino without having to cross over one another.

Don
« Last Edit: December 23, 2010, 06:08:28 pm by floresta » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, to get a better view, i turned the breadboard 180° and wired everything again. Just changed the wireing in the code:

Code:
/*
  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
 * 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 8 Feb 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(2, 3, 9, 10, 11, 12);

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

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

Aaaand at last: A picture of the tidied wireing smiley-grin :

http://www.flickr.com/photos/kuhnikuehnst/5286800736/

and still nothin works...  :'( What else can I do to may fix it? I already asked the LCD wheter it will work as a christmas present, but it didn't wanted to... damn!

greetings kuhni
« Last Edit: December 23, 2010, 07:06:41 pm by 92888488 » Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's got to be something simple that we are overlooking.  I still suspect a bad connection between the Arduino and the LCD so now it's time to get out the magnifying glass and check the solder connections on the LCD pins.  Look for poor joints and for bridges (shorted pins).  

The reversed backlight connections that seem to work OK still bother me as well.

Also, you never commented on this (from reply #3)
Quote
I am assuming that you can vary the intensity of the blocks from very dark to very light

Can you measure the voltage between GND and pin 2 as well as between GND and pin 3?

Don
« Last Edit: December 23, 2010, 09:18:21 pm by floresta » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I already checked the soldering before I started programming the arduino. Pin 16 wasn't soldered that good, so I wired it again. I checked the other pins by using the "diode" test of my multimeter (one Pin to the soldered Pin, the other to the board. All pins are soldered well).

That's right! By using the Potentiometer, I kan vary the intensitiy of the blocks from very dark to very light. I read of some Problems if the contrast isn't adjusted properly. But I am able to adjust the contrast and tried already all "positions" :-)

The voltage of GND and Pin 2 is between 5,00V and 5,02V.

GND to Pin 3 is between 0V and 5V regulated by the Potentiometer. The "best legibility" is around 0,35V (the contrast isn't to high, and the blocks are already visible).

There are also no bridges between pins  :-/

Slowly I'm getting despaired!

What else can I try to fix this damn problem?

Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

We are back to this "The reversed backlight connections that seem to work OK still bother me as well."

That type of display is almost, but not impossible, to view without the backlight.  Try disconnecting both backlight wires and see if you can discern anything on the display when you run your sketch.

Don
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

so... disconnected pin 15 and 16... aaand: still 2 rows of blocks visible... nothing less, nothing more... :-(

really baaad! >smiley-sad
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Anyone an Idea what else I could do to fix the problem? Don't wanna expend another 22 Bugs on a new LCd...  :-/

greetings kuhni
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know what happened to all the other LCD guru's. I'm still thinking about it.  It almost has to be something to do with one or more of the six data lines between the Arduino and the LCD.  

Don
« Last Edit: December 25, 2010, 08:59:28 am by floresta » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I also tried this code to bar a mistake of the lcd library:

http://webcache.googleusercontent.com/search?q=cache:iXmbLbXGIIkJ:www.arduino.cc/en/Tutorial/LCD8Bits+arduino+8+lcd&cd=3&hl=de&ct=clnk
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your display of two rows of blocks is an indication that the LCD is not properly initialized.  This could be due to a wiring problem or a code problem.

I just can't understand why virtually every LCD program author decides that they should deviate from the initialization sequence given in the datasheet.  The code you referenced is another example of this, and it's worse than most.  

Follow the LCD Initialization link at http://web.alfredstate.edu/weimandn, scroll down to the section on 8-Bit Interface, Initialization by Instruction, and compare it to the code you tried.  

The LiquidCrystal library isn't totally correct either and that could possibly be your problem, but it's not likely.  

Don
Logged

Pages: [1] 2   Go Up
Jump to: