Weird Results from LCD

Hey, I am getting weird results from my lcd screen. I attached a image below. It is a 4x20 lcd screen. As you can see its all black boxes except for the first 8 boxes in rows 1 and 2. I can faintly see hello, world in the unblacked boxes. My code is:

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

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

void loop() {
}

Any help or ideas would be amazing…i have checked the wiring about a dozen times and followed the helloworld tutorial from the main site.

I don't think you used a potentiometer. Felt sorry you followed the tutorial 12 times without noticing you are missing a part they probably mentioned in step 2. Unless you use a potentiometer, you will continue to see the black boxes and probably faint texts also.

BTW, I looked at your wires. Hard to trace, you used identical colors for neighboring pins. Also, your 5V pin is pretty loose. I can even see the metal pin, which should be inside the female header instead of showing.

the 5v pin was bent and i was getting a good connection with it anyways but i fixed it. I was using a 1k resister which is supposed to be the correct resister according to the nerd kits guide which i got this lcd from but nothing shows up then. I dont have a 10k pot so ill pick one up tomorrow and get it a try but what i find weird is the the boxes dont show on the first 8 lines on rows 1 and 2. Every other help post i have looked at, they say the boxes fill the whole entire line.

The kit should have said to use a potentiometer instead of a resistor. One resistor will not do anything meaningful. Two resistors will be more useful but you need something adjustable. I recommend you purchase a 10Kohm potentiometer before trying anything else. I've not seen missing black boxes either but since you are not operating the LCD correctly, anything could happen.

Go to AX-man surplus in Midway if you live near the cities and get a cheap one hopefully with pins that plug into your breadboard. They have several stores in the metro.

I'm in St. Cloud. If you live nearby, I can give you one for free :wink:

I would say that you have a faulty LCD controller chip. If you look on the back of your display you should find five ICs (or epoxy blobs). One is the main controller chip and the other four are auxiliary controllers. The main controller has all of the 'smarts' and all of the memory. It also has the circuitry to display 16 characters, the ones that are blank in your picture. Each of the auxiliary controllers provides the circuitry to display another 16 characters and those appear to be functioning. It looks like it is time to dig out your credit card.

Don

floresta:
I would say that you have a faulty LCD controller chip. If you look on the back of your display you should find five ICs (or epoxy blobs). One is the main controller chip and the other four are auxiliary controllers. The main controller has all of the 'smarts' and all of the memory. It also has the circuitry to display 16 characters, the ones that are blank in your picture. Each of the auxiliary controllers provides the circuitry to display another 16 characters and those appear to be functioning. It looks like it is time to dig out your credit card.

Don

Sounds like a very possible reason coming from someone very experienced with this type of displays. Don, did you read HD44780 doc like 500 times or just used HD44780 displays too much to know this much about them? I have the doc but just started to slowly digesting it.

Don, did you read HD44780 doc like 500 times or just used HD44780 displays too much to know this much about them?

Both of these I guess.

We have used these displays in our assembly language programming courses since the early 1990s because they are really good for teaching how to interpret and implement timing diagrams. If you don't get everything right then nothing works.

When we first started we didn't have the Hitachi datasheet (and we didn't have an internet either). What we did have was a catalog from Optrex that had just enough information to get us going. There was the Write and Read timing chart, the instruction set, a font table, and the initialization flowcharts, along with information specific to the module such as the pinout and the recommended potentiometer connections.

We had been using our 8085 processors for several years before we started tinkering with the LCDs so we were pretty sure that when the LCD didn't work it was in our interpretation of the LCD information and not on the microprocessor implementation. By the time we switched over to the 68HC11 we had the LCDs down pat so the reverse was true.

I still pick up a new tidbit now and then. I only recently realized that I was reading data from the LCD incorrectly (although it worked with my devices) when checking the busy flag. I was pulsing E and then getting the data where I should have been getting the data while E was high.

Don