Maker Pro
Maker Pro

HD44780 data pins

Hi all,

I have a HD44780 and I'm trying to have the four data pins do double duty as button inputs.

When the LCD is idle, I set BUTTON_COM low and make the four data pins inputs (with internal pullup resistor) so they can be pulled down by the switches.

When I have to write to the LCD, I make BUTTON_COM an input and the diodes stop the buttons from messing with the data lines.

This setup worked well using a PCF8574 i2c input expander, and again direct to a 5V microcontroller.

Now I'm trying to use a 3.3V microcontroller (directly connected), but still run the display on 5V. The datasheet says it should be OK for logic levels (low should be <0.6V, high should be >2.2V).

The problem I'm having is that the LCD's data pins pull up quite strongly to 5V, which is no good for the 3.3V microcontroller when I turn those four data pins into inputs. I have read the datasheet top to tail and can't find anything relevant, especialy given that I have the R/W line tied to GND so the whole unit is supposed to be write only.

Is there anything I'm missing in the HD44870 that will stop it from doing this?

thanks for any input.
 

Attachments

  • Untitled.png
    Untitled.png
    230.2 KB · Views: 3
Last edited:
After much fiddling I managed to work it out and use the LCD's inherent pull-ups to my advantage.

I realised I didn't need to pull the data lines all the way to ground, just down to 3.3V so it's safe for the microcontroller. 33k was about right to do that.

The only slight drawback is that the buttons are only able to pull the data lines down to 640mV through the diodes. The microcontroller needs <825mV for a definite logic low so it's a little bit close, but I guess if I keep all the wires short and the power is stable it will be OK. I measured the actual logic transition point of a ESP32 GPIO input and it's close to 1.6V.
 

Attachments

  • Untitled2.png
    Untitled2.png
    171 KB · Views: 2
Top