2
\$\begingroup\$

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; timings from a logic analyzer

Link to the datasheet

What am I doing wrong?

\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – AndrejaKo Jun 9 '12 at 16:13
  • \$\begingroup\$ @AndrejaKo It made no difference... \$\endgroup\$ – varesa Jun 9 '12 at 16:19
  • \$\begingroup\$ I'm pretty sure that it's a timing issue somewhere, but at the moment, I can't figure out where it could be. \$\endgroup\$ – AndrejaKo Jun 9 '12 at 16:48
  • \$\begingroup\$ 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. \$\endgroup\$ – Chef Flambe Jun 9 '12 at 16:54
  • \$\begingroup\$ @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. \$\endgroup\$ – varesa Jun 9 '12 at 17:41
2
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Could you post a more accurate diagnosis of the problem? It seems quite vague to be helpful in this form. \$\endgroup\$ – clabacchio Jun 14 '12 at 7:26
  • \$\begingroup\$ @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... \$\endgroup\$ – varesa Jun 14 '12 at 7:31
  • \$\begingroup\$ 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 \$\endgroup\$ – clabacchio Jun 14 '12 at 7:35
  • \$\begingroup\$ @clabacchio Sadly I do not have the breadboard and other stuff available, I thought of the same thing... \$\endgroup\$ – varesa Jun 14 '12 at 7:44
1
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ @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. \$\endgroup\$ – Kevin Vermeer Jun 13 '12 at 21:50
  • \$\begingroup\$ @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... \$\endgroup\$ – varesa Jun 14 '12 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.