Electronic – HD44780 based LCD display shows half-black, half-blank

character-lcdlcdpic

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?

Best Answer

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.