Lcd 2x16 Hd44780 init on Power on

Hi all
I still use old version ArduinoV13 on diecimila atmega168
With LCD 2x16 Hd44780

I had try 2 way to drive this LCD

1/ with old 2006 Dave Sopchak example
Hi send “manually” setup command to LCD one by one
Not so friendly than Liquidcrystal lib.
But it's work fine

2/ with Liquidcrystal lib. Very easy to drive LCD but !

After loading sketch from Arduino IDE both sketck work fine

But if I switch power off

And want to start stand alone diecimila board on power on

Only the solution 1/ start and work fine

With Liquidcrystal lib. LCD init after power one seem bad! LCD Hang 1 dark line
I don't know how Liquidcrystal initialize the LCD
I knew LCD take time to power on and uP should wait before initialize LCD

I would like to use liquidcrystal Lib. (more easier to drive LCD)

regards

I have modified the arduino-0015 's LiquidCrystal lib for fixing this issue . And the arduino-0017's new LiquidCrystal lib still have this bug.

you can download the modified library here to solve this problem here:
http://www.seeedstudio.com/depot/lcd-162-characters-green-yellow-back-light-p-62.html

And the arduino-0017's new LiquidCrystal lib still have this bug.

The older LiquidCrystal libraries did not initialize the LCD module correctly but those problems were corrected in the new version that is included with v0017.

Could you please explain the nature of the bug in the latest version of LiquidCrystal?

Don

well i had the problem that the back light didnt work with the example for hello world so i added some stuff
Look at the instructions it tells u how to attach the led for the backlight

Pot=potentiometer :slight_smile:

/*
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)
  • Backlight (down)
  • Pin 16 to grounf (Pot)
  • Pin 15 to 5 volt

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 25 July 2009
by David A. Mellis

*/

// 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 rows and columns:
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);
}

The IDe version 17 is indeed correct, in as much as it correctly waits for a Hitachi 44780 to complete its power up sequence, and then correctly initializes the display.

Logically and temporally correct.

For a Hitachi HD44780.


The problem is all these 'clones' of the HD44780 that are being marketed. Many, if not most, just aren't up to snuff.
In particular they don't complete their powerup sequence nearly as quickly as the 'real deal'.

This is not a problem with the library. It just needs to be made clear that the library targets a genuine, Hitachi, HD44780, and use with any other chip may require timing adjustments.

I have used the (newest, IDE v 17) library with at least a couple dozen displays that were clones... and on all but a couple I had to add additional time for them to power up. Eventually I just got in the habit of calling delay(1000) before 'begin()'.

I have seen this complaint crop up a lot on these forums. The only real answer is to let people know they may need to add more time before trying to communicate with their particular display.


Another problem I have seen with some displays is that they 'forget' that they are in 4 bit mode if they are not 'exercised' for a while.

The first one drove me absolutely nuts! I was convinced there was a power problem, dropouts or spikes.
I put it on a lab power supply and put a 50 Mhz rate storage scope across the power leads. Never saw a glitch, but after idling a while, the next attempt to write would cause either garbage or a blank display.

So I experimented with delays. Count up, print(count,DEC), delay(n). When the delay reached about 700 seconds, glitch city.

So now I always put in an idle function, and reset 4 bit mode after 1 minute of inactivity. Between the initial 1 second delay and the inactivity timer, it seems to have 'fixed' the problem... (knocking on wood).

Big thanks for all

on my laptop i had old version V13

you are right with IDE_V17 LiquidCrystal lib. restart fine after power off.

great forum help

regards