Help with a 20x4? LCD.

Hello all. I recently acquired a good amount of surplus LCD's. Based on size, I assume they are 20x4. They use the HD44780A00 and HD44100H to drive them. When I wired one up, I got the attached image. They all are oriented in portrait mode and only act like a 4x8 LCD. Is this something that can be reconfigured via software or will I have to figure out how to make due with they way they are? Thanks for any help.

Yes, it looks like 8x4.

As far as I know, you will not be able to change it in software.
Even when you successfully initialise it, you will have an ugly display.

Just buy a regular 16x2 or 20x4 from Ebay and move on.

David.

As far as I know the LiquidCrystal library is not set up to deal with 8x4 displays, but all is not lost.

In simple terms when the lcd.begin instruction is parsed the first number is used by the cursor positioning commands to specify the first address of each row on the display. The second number is used to deal with the controller memory layout and only the number '1' is significant, signifying the use of 1 line of memory. All other numbers result in the use of 2 lines of memory.

I would start by specifying a 20x4 display and printing a 4-row message. If that doesn't work then try 16x2 and reposition the cursor for the alternate rows.

Here are two untested examples:

#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

void setup()
 {
 lcd.begin(20, 4);
 lcd.print("line 1");
 lcd.setCursor(0,1);
 lcd.print("line 2");
 lcd.setCursor(0,2);
 lcd.print("line 3");
 lcd.setCursor(0,3);
 lcd.print("line 4");
 }

void loop()
 {
                                            // do nothing in 'loop'
 }



#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

void setup()
 {
 lcd.begin(16, 2);
 lcd.print("line 1");
 lcd.setCursor(8,0);
 lcd.print("line 2");
 lcd.setCursor(0,1);
 lcd.print("line 3");
 lcd.setCursor(8,1);
 lcd.print("line 4");
 }

void loop()
 {
                                            // do nothing in 'loop'
 }

The lines may initially come out in the wrong order but you should be able to interpret the results and fix things up.

Don

david_prentice:
Yes, it looks like 8x4.

As far as I know, you will not be able to change it in software.
Even when you successfully initialise it, you will have an ugly display.

Just buy a regular 16x2 or 20x4 from Ebay and move on.

David.

Got them for free and they came with a bezel that only shows the 4 rows. Should be able to do something with them.

floresta:
As far as I know the LiquidCrystal library is not set up to deal with 8x4 displays, but all is not lost.

In simple terms when the lcd.begin instruction is parsed the first number is used by the cursor positioning commands to specify the first address of each row on the display. The second number is used to deal with the controller memory layout and only the number '1' is significant, signifying the use of 1 line of memory. All other numbers result in the use of 2 lines of memory.

I would start by specifying a 20x4 display and printing a 4-row message. If that doesn't work then try 16x2 and reposition the cursor for the alternate rows.

Here are two untested examples:

#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

void setup()
{
lcd.begin(20, 4);
lcd.print("line 1");
lcd.setCursor(0,1);
lcd.print("line 2");
lcd.setCursor(0,2);
lcd.print("line 3");
lcd.setCursor(0,3);
lcd.print("line 4");
}

void loop()
{
                                            // do nothing in 'loop'
}

#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

void setup()
{
lcd.begin(16, 2);
lcd.print("line 1");
lcd.setCursor(8,0);
lcd.print("line 2");
lcd.setCursor(0,1);
lcd.print("line 3");
lcd.setCursor(8,1);
lcd.print("line 4");
}

void loop()
{
                                            // do nothing in 'loop'
}





The lines may initially come out in the wrong order but you should be able to interpret the results and fix things up.


Don

Thanks for sending me in the right direction. I got it to work! Only change I had to make was changing " lcd.begin(20, 4);" to "lcd.begin(8, 4);".

(20,4) only displayed the first 2 lines.

What cursor positioning technique did you wind up using?

Don

This is the code I ended up using to get it to work:

#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // put your pin numbers here

void setup()
{
lcd.begin(8, 4);
lcd.print("line 1");
lcd.setCursor(0,1);
lcd.print("line 2");
lcd.setCursor(0,2);
lcd.print("line 3");
lcd.setCursor(0,3);
lcd.print("line 4");
}

void loop()
{
// do nothing in 'loop'

As far as I know the LiquidCrystal library is not set up to deal with 8x4 displays, but all is not lost.

Well the first part of that statement is obviously not correct.

At one point the LiquidCrystal library did not correctly position the cursor for the 16x4 displays. I just took another look at the library code. The code modifications that fixed the 16x4 bug enabled the library to deal with 8x4 displays as well.

Don