# HD44780 based LCD display shows half-black, half-blank

I have been trying to get a HD44780 LCD display to work for multiple times. The first time was by parallel port from a computer, then multiple times using different PIC uCs. I am only able to get the display to show half of the dots (the right side of the screen) as black, and the left side as blank/white. I read from the internet that it means the display is not initializing properly.

The display is Tianma TM161A/B

    setData(0b00110000); // INIT
strobeE();

DelayMs(5);

setData(0b00110000); // INIT
strobeE();

DelayMs(5);

setData(0b00001111); // ON/OFF
strobeE();

DelayMs(5);

setData(0b00000001); // CLEAR
strobeE();

DelayMs(5);

setData(0b00000110); // ENTRY MODE
strobeE();

void strobeE() {
mPORTDSetBits(E);
DelayMs(1);
mPORTDClearBits(E);
}


I have used a logic analyzer, a logic probe and a multimeter to check if the connections between the PIC and the LCD are correct. I think they are.

A ( bad ) picture of my timings on a logic analyzer;

What am I doing wrong?

• Try increasing all delays to maybe 10 ms. Few years ago when I was trying o start such a display, I found out that the delays specified in the datasheets were usually too short for some reason. – AndrejaKo Jun 9 '12 at 16:13
• @AndrejaKo It made no difference... – varesa Jun 9 '12 at 16:19
• I'm pretty sure that it's a timing issue somewhere, but at the moment, I can't figure out where it could be. – AndrejaKo Jun 9 '12 at 16:48
• Are you sure the LCD is functional or if it's your code? I was using a NorthMicro proto board and thought my code was bad when in fact the contrast was just set too low for anything to display. Found that out by using another guys LCD with my code. – Chef Flambe Jun 9 '12 at 16:54
• @ChefFlambe Well I can't be sure about that, unless I can get my hands on display I have seen to work with some code, but I have 3 displays ( 2 Tianma, 1 Displaytech ). One of the Tianmas seems completely dead, and I assume it is broken. Other two show the black bars. Would be really bad luck to have 3 broken displays. – varesa Jun 9 '12 at 17:41

The problem with the display not initializing was because of a loose wire. It was either RS or RW, that was left floating.

My logic analyzer showed it being in the low state, but seems the LCD's controller thought otherwise. (Different kind of input)

A tip:
Check your wirings: not connected != input driven low

A logic probe, which emits a high, or low pitch sound depending on the signal, helped me find the problem. It did not give any kind of sound at all on that pin.

• Could you post a more accurate diagnosis of the problem? It seems quite vague to be helpful in this form. – clabacchio Jun 14 '12 at 7:26
• @clabacchio What should I post? When nothing else worked, I checked my wiring one more time... I don't think that was the original problem, but it's hard to know now... – varesa Jun 14 '12 at 7:31
• you should try to bring it to the previous state, and replicate the error, if possible. Otherwise, not to be rude, your answer won't be useful to anybody else – clabacchio Jun 14 '12 at 7:35
• @clabacchio Sadly I do not have the breadboard and other stuff available, I thought of the same thing... – varesa Jun 14 '12 at 7:44

Check your "function set" word (0b00110000). bits 2 and 3 (N and F in datasheet) set display shape. If they are set incorrectly, part of display will not function -- try all 4 combinations.

• @varesa - That's great, but people are still trying to help you! It would be great if you would answer your own question so that future readers with the same problem can benefit from your solution. – Kevin Vermeer Jun 13 '12 at 21:50
• @KevinVermeer Yeah, I thought I had accepted someone's answer, but seems I hadn't ( there weren't even any answers before this). I was too lazy to write one last night... – varesa Jun 14 '12 at 7:01