Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Interfacing LCD to Atmega using two wires

This is not new Idea of interfacing LCD using two wires, but it can help in many situations when there is not enough of microcontroller pins. This example is based on Hitachi 44780 Alphanumerical LCD.


This circuit I provide is only to represent an idea but I think it should work also if soldered. We know, that to make LCD working you need at least 6 (in 4 bit mode) wires to control. But what if you need as many pins as possible from your avr and still want to see results on LCD. Then you need to use serial LCD or make one.

In this example you just need to convert serial data coming to LCD using shift register. I suggest using 74HC164. You need only two wires to push data to shift register and then give them to LCD using “E” strobe signal.

So how this operates?

Atmega’s PC1 pin clocks shift register and PC0 is data line. Before you write to shift register clean it by sending “0” in eight clock cycles. You can erase register with additional wire controlling register reset, but there would be 3 lines used.

After register is cleared, send eight bits to register. First bit sent is always 1, as it is used to strobe LCD, second bit is Register Select, and then one bit is not used and then follows 4 bits as data and las bit is always 0 in order to make strobe E work correctly. You should see that in eight clock cycle last bit in shift register enables LCD with “1” value in last bit. Then by sending “1” to data line you enable LCD E pin. Resistor and Diode acts there as AND element. If only register Q7 signal is active, but data low, then LCD E pin is low. If data line is high but 74HC164 register Q7 pin is low, then diode pulls low this signal and LCD pin will be low. Only when both PC0 and shift register Q7 are high, ten LCD pin E is strobed.

Added some Test routine Programmed with WinAVR. I tested and it is working.


  1. I have corrected this schematic by including AND gate for enabling E pin of LCD. LCD will be enabled when both Data input and shift registers output Q7 will be logical “1”. Without AND gate it was impossible to clear LCD because while clearing data shifts forward through E pin and this enables LCD multiple times by by writing dummy data to it.

  2. Pingback: Conectarea unui lcd 44780 prin 2 sau 3 fire « Arduino Project -Arduino Romania

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.