Go Down

Topic: HD44780 20x4 issue (showing all squares) (Read 4 times) previous topic - next topic

altagest

Man i tried all the stuff above, i even connected the contrast pin to a digital out (pin 9) to select the voltage... like that:

Code: [Select]


void setup() {
  pinMode(9, OUTPUT);
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);
  analogWrite(9, 145); //let's try...
  // Print a message to the LCD.
  lcd.print("hello, world!");
}



and the less value i put like

Code: [Select]

analogWrite(9, 20);


the bigger the contrast is. If i put analogWrite(9,200) i see like 0 contrast. But i can't see any data, only squares.

I think i burned something (like some driver, if there is any). :(

floresta

Let's start all over again.

From your original post:
Quote
I'm having a trouble with a 20x4 LCD.

It would help if we knew exactly which LCD you are using.  It's part number would be sufficient and a link to it's data sheet would be even better.

Quote
Obviously, every connection is made correctly.

This is not at all obvious since your display is not working properly.  It is quite possible that you are completely misinterpreting your pin connections, especially if you are using a device with it's row of pins below and to the left of the display.  A photograph of your connections would really help here.

From Reply #5:
Quote
I've got a trimmer (10KOhms) but i'm having same issue with this code ...

The code that you are using has nothing to do with the ability to adjust the trimmer to set the correct contrast.  As a matter of fact you can, and probably should, adjust the trimmer before you ever connect your LCD to your Arduino.

Replies #7 and #9:
Here we are guessing as to what voltage is being used to power your LCD module.  Why don't you just tell us?

Reply #10
Quote
Man i tried all the stuff above, i even connected the contrast pin to a digital out (pin 9) to select the voltage... like that:

I wasn't aware that you could use Analog write with a digital pin.  You cannot get the correct contrast setting this way.  With a digital pin the output is either high or low.  With the output high your display will be blank and with the output low you will (usually) get dark blocks everywhere.  Once again - you should get the contrast adjusted properly before you try to run any code and preferably before you even connect the Arduino.  If you want to use PWM to set the contrast then do that later on, after you have the device working.

Quote
I think i burned something (like some driver, if there is any).

As long as you are seeing the squares there's a good possibility that your display is still usable.

Don


altagest

So, that is what i've done. sorry if it's a little bit confused, but this should clarify what i'm doing.
Let me know what you think!

DEAFBOY


So, that is what i've done. sorry if it's a little bit confused, but this should clarify what i'm doing.
Let me know what you think!


Open -> Liquid Crystal -> HelloWorld


altagest



So, that is what i've done. sorry if it's a little bit confused, but this should clarify what i'm doing.
Let me know what you think!


Open -> Liquid Crystal -> HelloWorld




Meh, the only thing that changes from what i'm doing, is the 5V+ connected to the potentiometer. So nothing changes. Right?

Go Up