4 bit LCD library and Hitachi HD44780 compatible display

floresta: What we really need to know is:

  1. The specific display that you are using.
  2. The specific version of the Arduino IDE that you are using.
  3. The specific library that you are using.
  4. ALL of the connections to your display (did you connect pins 3 and 5?).
  5. ALL of the code that you are using.
  6. The exact contents of the display that resulted (did the quotation marks and exclamation point really disappear?).
  7. How you managed to get 22 characters displayed on a 20 character wide display.

Then we may be able to give some specific help.

Don

modified above post to reflect the questions

What about #4?

liudr: What about #4?

sry i only but connected ones here are the non connected ones

3- contrast 5-RW 7 DB0 8 DB1 9 DB2 10 DB3

modified above post to reflect the questions

This is really not a good procedure since the reasons for my original questions are now no longer part of the thread. It makes me look like an idiot and it makes it hard for anyone who reads this in the future to follow the entire troubleshooting procedure.

Your answer to #6 does not mention anything about the second row of information. Did anything appear? Were there extra spaces?

sry i only but connected ones here are the non connected ones

I can't believe that your display shows anything with pins 3 and/or 5 floating.

Don

floresta:

modified above post to reflect the questions

This is really not a good procedure since the reasons for my original questions are now no longer part of the thread. It makes me look like an idiot and it makes it hard for anyone who reads this in the future to follow the entire troubleshooting procedure.

Your answer to #6 does not mention anything about the second row of information. Did anything appear? Were there extra spaces?

sry i only but connected ones here are the non connected ones

I can't believe that your display shows anything with pins 3 and/or 5 floating.

Don

sry for the modification i havent posted much here.

as for second row i did not send anything to second row in the test

now it get interesting

first i changed the code to

lcd.begin(20, 2);
  // Print a message to the LCD.
  //lcd.setCursor(0, 0);
  lcd.print("hello, world!");
  lcd.setCursor(0, 1);
  lcd.print("byebye, world!");

this resulted in the first line still messed up but the second line perfect

next changed to

lcd.begin(20, 2);
  // Print a message to the LCD.
  lcd.setCursor(0, 0); //first line
  lcd.print("hello, world!");
  lcd.setCursor(0, 1); //second line
  lcd.print("byebye, world!");

this resulted in first line perfect and second line with spaces between each character sent

Let's get pins 3 and 5 taken care of first. Most displays are blank with pin 3 floating (unconnected) and they will show unpredictable behavior with pin 5 floating. Your display seems to behaving somewhat unpredictably.

Don

i have connected a compatible display to my arduino ... the display is a CU20025ECPB-U1J

Can you point us to some documentation for this display. As far as I can tell it is a VFD display, not an LCD so that changes things a bit.

Don

floresta:

i have connected a compatible display to my arduino ... the display is a CU20025ECPB-U1J

Can you point us to some documentation for this display. As far as I can tell it is a VFD display, not an LCD so that changes things a bit.

Don

data sheet http://www.datasheetarchive.com/CU20025ECPB-U1J-datasheet.html

there are also other posts on the forum that i read where people are using the arduino library for the vfd. it is an lcd compatible vfd

As floresta says, leaving the RW pin floating is asking for trouble. You need to connect it to ground.

dc42: As floresta says, leaving the RW pin floating is asking for trouble. You need to connect it to ground.

RW is now connected to ground, same results

Is jumper link J2 soldered or open?

Don

floresta:
Is jumper link J2 soldered or open?

Don

i will check but i have been experimenting and here is what i found out(work arounds)

basically if i issue the lcd.setCursor command twice except the very first time, everytime it is used then everything works fine
example one

/*
  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, 6, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(20, 2);
  // Print a message to the LCD.
 
  lcd.setCursor(0, 0);
  lcd.print("hello, world!");
  //delay (10);
  lcd.setCursor(0, 1);
  lcd.setCursor(0, 1); // added second time here and it now works
  lcd.print("byebye, world!");
  //lcd.setCursor(0, 0);
  //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);
  //lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  //lcd.print(millis()/1000);
  //delay(50);
}

example 2

/*
  LiquidCrystal Library - Autoscroll
 
 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 demonstrates the use of the autoscroll()
 and noAutoscroll() functions to make new text scroll or not.
 
 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://arduino.cc/en/Tutorial/LiquidCrystalAutoscroll

 */

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

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(20,2);
  lcd.setCursor(0, 0);
}

void loop() {
  // set the cursor to (0,0):
  lcd.setCursor(0, 0);
  lcd.setCursor(0, 0); // added repeat
  // print from 0 to 9:
  for (int thisChar = 0; thisChar < 10; thisChar++) {
   lcd.print(thisChar);
   delay(500);
  }

  // set the cursor to (16,1):
  lcd.setCursor(20,1);
  lcd.setCursor(20,1); //added repeat
  // set the display to automatically scroll:
  lcd.autoscroll();
  // print from 0 to 9:
  for (int thisChar = 0; thisChar < 10; thisChar++) {
    lcd.print(thisChar);
    delay(500);
  }
  // turn off automatic scrolling
  lcd.noAutoscroll();
  
  // clear screen for the next loop:
  lcd.clear();
}

floresta: Is jumper link J2 soldered or open?

Don

it looks like it is open

zarobhr:

floresta: Is jumper link J2 soldered or open?

Don

it looks like it is open

OK - That means that pin 5 functions the same way as the Hitachi chip and to work correctly with the LiquidCrystal library it must be connected to GND.

It looks like pin 3 is a /Reset pin so you really should connect it to +5V, preferably via a pull-up resistor.

there are also other posts on the forum that i read where people are using the arduino library for the vfd. it is an lcd compatible vfd

Your results seem to indicate that the instruction set is the same as (or very similar to) the one for the HD44780 but at least some of the timing is not compatible. It would help if you could dig up a full data sheet.

Don

floresta:

zarobhr:

floresta: Is jumper link J2 soldered or open?

Don

it looks like it is open

OK - That means that pin 5 functions the same way as the Hitachi chip and to work correctly with the LiquidCrystal library it must be connected to GND.

It looks like pin 3 is a /Reset pin so you really should connect it to +5V, preferably via a pull-up resistor.

there are also other posts on the forum that i read where people are using the arduino library for the vfd. it is an lcd compatible vfd

Your results seem to indicate that the instruction set is the same as (or very similar to) the one for the HD44780 but at least some of the timing is not compatible. It would help if you could dig up a full data sheet.

Don

here is another datasheet i found

http://www.ko4bb.com/Manuals/09)_Misc_Test_Equipment/Noritake/Noritake-HD44780.pdf

here is another datasheet i found

http://www.ko4bb.com/Manuals/09)_Misc_Test_Equipment/Noritake/Noritake-HD44780.pdf

I found that one last night. It is not a data sheet it is an application note which is valuable, but not the same. If you look at the last page you will find some significant timing differences mentioned which may not be satisfied by the LiquidCrystal (or any other LCD) library. The difference in the Address/data hold time is significant when you consider that the processor can do 11 typical instructions during that 700nS.

Of course you have to speculate on the accuracy of all of the information after you read their description on the previous line concerning what happens on a regular LCD when you write more than 64 (actually 80) bytes of data.

Don

i could not find another datasheet, but my work around of issuing the lcd.setCursor command twice everytime i want to use it works flawlessly

i justed wanted to update this

Since I changed to the New Liquidcrystal library i no longer have this issue

https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads

i have also in the meantime switched to using I2C and it still works flawlessly

Thanks for the update.

Don