Newhaven LCD help

So I have been using a 16x2 LCD from Adafruit and the tutorial worked great (Arduino Tutorial - connecting a parallel LCD). The issue I had was that the display was too big to fit the application I needed. So while reading the tutorial I noticed that it said that the code and wiring should work for any character LCD. So I found a 20x2 display from Newhaven and I am having fits with this thing. I was wondering if anyone has any insight into what is going on.

Here are some images of what I am seeing.

Here is an image of my wiring.

If I change the "lcd.begin(16, 2);" to "lcd.begin(20, 2);" it doesn't change anything. Also if I set the LCD cursor to 0,1 or 0,2 the display doesn't change.

The LCD has pinouts that match the 16x2 LCD I was using (Standard LCD 16x2 + extras [white on blue] : ID 181 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits, data sheet http://www.adafruit.com/datasheets/TC1602A-01T.pdf). The data sheet for the LCD I am trying to use is http://www.newhavendisplay.com/specs/NHD-0220FZ-FSW-GBW-P.pdf

I am completely stumped. If anyone has anything I am all ears.

Thank you

If I change the "lcd.begin(16, 2);" to "lcd.begin(20, 2);" it doesn't change anything.

This is normal. I should refine this to say that this is normal operation for the LiquidCrystal library as it is currently written. It does not use the first argument at all and only checks to see if the second value is greater than 1.

Also if I set the LCD cursor to 0,1 or 0,2 the display doesn't change.

I would suspect that this should have a big effect since your display has only two rows of characters and they are numbered 0 and 1

Many of the New Haven displays have capabilities that are different from the run-of-the-mill LCDs and therefore have some unique programming requirements. This one, aside from the duplicate set of pins, appears entirely normal.

Try the following sketch and see what happens. Check out the LCD Addressing link at http://web.alfredstate.edu/weimandn if you aren't sure what should be displayed.

#include <LiquidCrystal.h>

//LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
  LiquidCrystal lcd(12, 11, 5, 4, 3, 2);       // put your pin numbers here

void setup()
  {
    lcd.begin(20, 4);
    for (int i=47; i<127; i++)                 // send 80 consecutive displayable characters to the LCD
    {
    lcd.print(i,BYTE);
    delay(100);                                // this delay allows you to observe the addressing sequence
    }
  }
void loop()
  {  
  }

Don

It doesn't seem to like the "BYTE".

Thank you for the quick response. This thing is driving me batty.

Another casualty of Arduino 1.0 I guess. See what happens with lcd.write(i); (Just guessing, I'm not a 'C' programmer.)

Don

Because of the way the print class is implemented you will now have to cast the value to
have it treated as a character if you pass it an int.

There are two options. (both work in either pre 1.0 or 1.0)

Either cast the argument like this:

for (int i=47; i<127; i++)                 // send 80 consecutive displayable characters to the LCD
{
       lcd.print((char) i);
       delay(100);                                // this delay allows you to observe the addressing sequence
}

Or don't declare i as an int but a char instead.

for (char i=47; i<127; i++)                 // send 80 consecutive displayable characters to the LCD
{
       lcd.print(i);
       delay(100);                                // this delay allows you to observe the addressing sequence
}

If the argument to print() is an "int" then the print class assumes you want
to see the int value and will convert it to the ascii characters that represent the decimal
value rather than outputting the character value of the integer.

--- bill

This is what I get when I use bperrybap's altered code.

void setup()
{
lcd.begin(20, 4);
for (char i=47; i<127; i++) // send 80 consecutive displayable characters to the LCD
{
lcd.print(i);
delay(100); // this delay allows you to observe the addressing sequence
}
}
void loop()
{
}

It looks as though it is completely skipping the first 4 characters. And it doesn't like 7's.

Any ideas?

Thank's Bill. I'll revise my example, load up Arduino 1.0, dig out a real Arduino board and check it out sometime soon!

Scoop (or is it poop): I'll take a closer look at the bit patterns but meanwhile could you check out your four data wires. You could have open or shorted wires and still be able to initialize the LCD and write some characters.

Don

I would say you have a bad LCD controller.

Not only are you missing the first four columns of characters (20 columns of bits) but you are also missing three out of the five columns of bits in the column with the 7 and the underscore.

Note that you see only part of the 7, part of the underscore below the '7', and part of the 'o' in 'world'.

Don

I actually do have another LCD of this same model and I am wiring it up now.

I did do a wire test and it seems to be ok.

I will post once I have the other lcd ready.

Thanks

wired up the 2nd one. It is better but still is missing half of the first character line.

So I squeezed it and lo and behold all of the characters lit up. There is something to the case around the LCD that is jacked up. If I squeeze it along it's length the characters change. Very strange.

Thank you for your help.

You guys will love this one...

So, I took a pair of pliers and pinched the tabs tighter against the sides and voila, it works completely now.

Weird (unless you understand why it did this).

And in conclusion, I took the original LCD and pinched those tabs, wired it back up and blam, it's perfect.

What a crock, it was never the code, never the wiring, it was all in shotty manufacturing!

Oh well, turns out when you get mad at components and squeeze them out of frustration sometimes good things can happen.

Don, Bill, thank you so much for helping me run this to ground.

Josh

I was out soaking in my spa and thought about pressing on the glass. I see you found that out without me. Well, at least we got a corrected version of the test sketch out of the deal.

Don

floresta:
I was out soaking in my spa and thought about pressing on the glass. I see you found that out without me. Well, at least we got a corrected version of the test sketch out of the deal.

Don

Maybe each living species has a collective consciousness
and your thoughts resonated on top of the Earths Schumann Waves over to Scoop. XD

( ~7 - 8 Hz, the frequency of human brain waves and the natural earth frequency
Schumann Waves, can easily travel vast distances with very little power. )

--- bill

Good to know your problem was solved by force :wink:

FYI, some diagrams. I bet it was the conductive rubber.

lcd_connector_rubber.jpg

lcd-compressed.jpg

scoopthepoop:
And in conclusion, I took the original LCD and pinched those tabs, wired it back up and blam, it's perfect.

What a crock, it was never the code, never the wiring, it was all in shotty manufacturing!

Oh well, turns out when you get mad at components and squeeze them out of frustration sometimes good things can happen.

Don, Bill, thank you so much for helping me run this to ground.

Josh

Ask the seller for some apologies or some money.