Stumped and confused driving a 4x40 display

Hello all,

New to the forums and this is a bit more of an involved project than I am used to.

I have a 4x40 character display (dual HD44780's, two enable pins etc) that I am looking to connect to my Arduino mega (1280). Searching online there are a few different threads/options, including LiquidCrystalEnhanced and LiquidCrystal440. Unfortunately they seem to be written back in 2010/11 and the IDE has changed since then and created errors that I cant solve my self. It seems like people have gotten it to work since then but I cant seem to make heads or tails of what they did or which library they used. Can anyone point me in the right direction of a library that works with the current IDE and a dual controller 4x40 display?

So, the situation is that you have to interface with the data pins because it doesn't have a serial/SPI interface?

Will it work with the "Liquid Crystal" library? If the two enable pins were jumpered together, it would show the same thing on both.
I can't tell you "here's what to do" to modify that library to work with two enables, but I could suggest working the enables using a couple of AND gates. (IOW, you'd have to select, separately/additionally, enable1/2 before making the LCD function call.)

Can anyone point me in the right direction of a library that works with the current IDE and a dual controller 4x40 display?

I believe that LiquidCrystal440 has been updated to work with the newer IDEs.

To get a copy start here:--> Google Code Archive - Long-term storage for Google Code Project Hosting. and follow the Downloads link to get to the latest version.

Edit: As an alternative you could probably use two instances of the standard LiquidCrystal library. The two constructors would have identical designations for all but the Enable pin.

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

Don

floresta:

Can anyone point me in the right direction of a library that works with the current IDE and a dual controller 4x40 display?

I believe that LiquidCrystal440 has been updated to work with the newer IDEs.

To get a copy start here:--> Google Code Archive - Long-term storage for Google Code Project Hosting. and follow the Downloads link to get to the latest version.

That is where I downloaded it from, I just grabbed the one with the most recent release date and it doesnt seem to work. I could try some of the older ones I suppose.

Edit: As an alternative you could probably use two instances of the standard LiquidCrystal library. The two constructors would have identical designations for all but the Enable pin.

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);

LiquidCrystal lcd1(7, 8, 9, 10, 11, 12);
LiquidCrystal lcd2(7, 6, 9, 10, 11, 12);





Don

And I didn't about doing that, it might just work, and then all it would require is some fancy coding to get things to appear in the right place. It would be nice to get a native library to work for everything but this is worth investigating.

I got it!

So after searching for awhile late one night I stumbled on this site:
http://www.ninemoons.com/cozumeldiver/LCD440_Application_Note.html

Following those instructions allowed me to get the code to compile, and from there it just took some investigation into the library files to figure out what goes where when initializing the screen.

Here is my example code to test it out:

/*

Arduino Mega 1280

  The circuit:
 * LCD RS pin (11) to digital pin 48
 * LCD Enable 1 pin (9) to digital pin 46
 * LCD D4 pin (1) to digital pin 41
 * LCD D5 pin (2) to digital pin 40
 * LCD D6 pin (3) to digital pin 39
 * LCD D7 pin (4) to digital pin 38
 * LCD Enable 2 pin (9) to digital pin 52
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)

 */

#include <LiquidCrystal440.h>  //include LCD library

LiquidCrystal lcd(48, 47, 46, 52, 41, 40, 39, 38);  //initialize lcd screen

void setup() {
  lcd.begin(40, 4);  // set up the LCD's number of columns and rows: 
  // Print a message to the LCD.
  lcd.setCursor(3, 0);
  lcd.print("TESTING");
  lcd.setCursor(9, 1);
  lcd.print("WOOO it works");
}

void loop() {
  
}