16x02 LCD with Pro Mini

Okay, I'm starting to feel pretty stupid but I can't find my error. In the past I connected tons of those 16x, 16x4, 20x4 etc displays. Mostly to a PIC microcontroller I must say. But all without problems.

Now I try to connect a (new from my own stock) 16x1 LCD to an Arduino Pro Mini. Connected it like said in Liquid Crystal Display page. But, because it was more confinient, change the mapping to:
Arduino LCD
GND -> Vss (pin 1)
Vcc (5V) -> Vdd(pin 2)
20k pot as voltage divider, wiper -> V0 (pin 3)
D9 -> RS (pin 4)
GND -> RW (pin 5)
A7 -> E (pin 6)
D10 -> D4 (pin 13)
D11 -> D5 (pin 12)
D12 -> D6 (pin 13)
D13 -> D7 (pin 14)

Opened up the LiquidCrystal HelloWorld sketch and changed the startup to:

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(9, A7, 10, 11, 12, 13);

void setup() {
  // set up the LCD's number of rows and columns: 
  lcd.begin(16, 1);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

I adjusted the contrast so all the blocks are just gone. But nothing... Changed the power supply from USB to my lab power supply set to 5V, nothing. More contrast, vague blocks, so nothing there.

Did a continuity test for all pins. The are all connected the right way. (not cross connected or shorted).

Swapped the LCD with another from the same batch, nope.

Swapped it for a 20x4 I had laying around, nope. (Yes, changed the lcd.begin() but should not matter.)

Okay, there is a new version of the lib. Deleted the stock lib, downloaded the new from GitHub and installed it (add .zip library). Restart. Okay, see new library. Open up the HelloWorld again, change the pins, nothing...

Tried to connect it with just DuPont wires, hole mess of wires but again, nothing.

Okay, maybe it's the LED connected to pin 13 of the Arduino. De-soldered that wire and made it to D8. Checked it with the DMM, it's fine. Re-upload the code but with
LiquidCrystal lcd(9, A7, 10, 11, 12, 8);
Still dead.

Called up a friend, yes, he had another LCD. Plugged that one in (16x2 version), adjusted the contrast again. Changed to code (LiquidCrystal lcd(9, A7, 10, 11, 12, 8); and lcd.begin(16, 2); ) and uploaded.
Nothing. Reset the board a few times and he, something! But it's just a bunch or random characters at the first line. :frowning: But they are clear so no problem with contrast. Also, they change sometime. But it doesn't look like the helloWorld sketch...

So now I don't know what I do wrong... Must be something stupid I guess...

Unlucky 13 ?
D10 -> D4 (pin 13)
D11 -> D5 (pin 12)
D12 -> D6 (pin 13)

Quote from myself:

septillion:
Okay, maybe it's the LED connected to pin 13 of the Arduino. De-soldered that wire and made it to D8. \

So tried that...

Hmmm try a different Arduino board? Use the default pins in that example? Can't see this being a code issue.

Tried different Arduino (another Pro Mini). Both I use all the time around my desk. Nothing.

Tried to original pins with DuPond but did not work. I'll try it on a breadboard again tonight...

Thats weird. Your wiring map looked fine anyway.

There is one other factor. Try upload to the Arduino from a different PC?

I adjusted the contrast so all the blocks are just gone. But nothing... Changed the power supply from USB to my lab power supply set to 5V, nothing. More contrast, vague blocks

so you did see something right?

or this ?

, so nothing there.

Which is it - something or nada, zipp ????

When you apply power to the display and even without data pins connected - can you adjust the contrast?
I assume your display has backlight, how is it powered?

Standard Hitachi LCD should display default character rectangles all across, on power up, after few hundred milliseconds.
It does not matter if the default LED 13 is still connected, it will just show irrelevant data, and even if it kills the data pin integrity you will still see weird characters.

Actually I use LED 13 as visual "all is well", and program is running cheap indicator.

If I turn V0 to 0V the I see blocks. On the 16x1 they are still a bit vague. Om the 16x2 they are clear. With the last one I sometimes get some random stuff on the screen (if I turn the contrast a bit down). Some changing random chars.

I can only see this on the 16x2 LCD. But I never see the helloWorld sketch. :frowning:

I on the 16x1 and 16x2 I don't have the backlight connected. The 16x1 doesn't have a backlight and the other is the old school green one you can read clearly when it's on the bench (under quite some light). The 20x4 is a blue one and I have wire hooked up to the 5V supply (resistor on board).

AS long as you are getting something there is still hope to fix this.
My best guess is that your data bus is at fault.
You are using 4 bits data bus so make sure they are all working / connected correctly.
Since you getting random garbage, you may have some path on your data bus open.
Just send 16 single characters , say "A" , and if you get SAME display in each character rectangle , hopefully an "A" it should give you a clue.
You may have the bus pins in incorrect order and it that case it should still display SAME garbage character across the LCD.
You may try to send a character which would use only ONE data pin,of the top of my head I don't know which one or if there is such thing in standard ASCII code. I'll will try that on my LCD just for kicks.

Actually sending "hello world " is not the best test. I use time tested

lcd_i2c.print("0123456789 The quick brown fox jumps over the lazy dog 01234567890 Full LCD test");

It verifies EVERY printable ASCII character, little overkill for modern technology , but effective.

PS Make sure you are using correct "viewing angle" TO OBSERVE your LCD ! Just saying...

Good luck

You may try to send a character which would use only ONE data pin,of the top of my head I don't know which one or if there is such thing in standard ASCII code.

That would be '@'.

It verifies EVERY printable ASCII character

Except for all the punctuation and upper case letters.

Hi,
Looking at pinout for Arduino Pro Mini

LiquidCrystal lcd(9, A7, 10, 11, 12, 13);

Where is pin A7?

Tom..... :slight_smile:
Have you tried hooking up to the traditional pins to see if it will work?
Can't be hard to swap connections and sketch.

TomGeorge:
Hi,
Looking at pinout for Arduino Pro Mini

LiquidCrystal lcd(9, A7, 10, 11, 12, 13);

Where is pin A7?

Tom..... :slight_smile:
Have you tried hooking up to the traditional pins to see if it will work?
Can't be hard to swap connections and sketch.

Where is pin A7

Very good catch / question.
I assumed that the IDE would kick it out if the symbol was not #define(d).
Obviously as an "enable" signal it HAS to be valid AKA connected somewhere in hardware.
I believe this signal is a multifunction signal , not just enable.
Floating pin would explain the inconsistent LCD behavior.
This is why asked to do 16 SAME character test.

To be picky - I don't think "tradition.."( Fidler on the roof ) should apply , just wire it CORRECTLY to valid pins of you liking.

I would have thought the pin a7 would have to be assigned as a input or output. If a pin was assigned as a pull-up would you have to re-assign it or would it automatically re-assign when loading the new code.

A7 is analogue in only.

gpop1:
I would have thought the pin a7 would have to be assigned as a input or output. If a pin was assigned as a pull-up would you have to re-assign it or would it automatically re-assign when loading the new code.

Most LCD libraries, if not all of them, actually assign the pin mode internally, but if would not hurt to do it in user code. On correct pin of course,A7 is not.
Originally I look at blurry hardware picture and did not see the A7 pin at all, so I assumed it does not exist in software and compiler should pick that up. Obviously I was wrong, because in this schematic A7 is refereed to as "off grid" so it should be easy to spot in hardware. I did not bother to look how it is physically connected in the PCB since it is a wrong pin to use anyway.

Sure would like to know where is the enable signal actually wired to, please do not send Fritzing picture!

Just check the connection and I will take your word for it.
Cheers Vaclav

Yesss, A7 was the big problem. (Found that before I looked at this topic again, should have looked first...) A7 is a correct pin on an Arduino but isn't on all variants. Even not on all Pro Mini's. But A6 and A7 are analog input only! It would have been nice if this information is on the Arduino Pro Mini board page...

But, if this was the only error I might have spotted it before but noooo :confused: Like I said, I wired the original LCD with DuPond wires to an Arduino Pro Mini, original Liquid Crystal Display pins. But I got nothing. But it turns out to be (very) bad luck... The new and fresh LCD (I even pealed the plastic off) from my stock is defective. D6 and D7 don't reach the HD44780 chip :confused: Traces are broken (have no idea how....) I discovered this because I used a breadboard to test again today. Wired it to the original pins etc but nothing. Then I swapped the LCD and tadaaaa, text! Took out my DMM and the HD44780 datasheet and D6 and D7 don't beep...

All in all it took me a lot more time then I thought it would. I imaged this to be a quick 1 day project but it turned out to be a week project...

Thanks for all the help!