Connect LCD to Atmega using 3 wires

After I implemented interfacing LCD to ATmega8 using 2 wires https://scienceprog.com/interfacing-lcd-to-atmega-using-two-wires/ I decided to make another one example but with 3 wires. Using 3 wires makes control much simpler as it is easier to control data flow to shift register. Here I used the same super cheap 74HC164 serial in parallel out register. LCD to shift register is connected in 8 bit mode. LCD strobe pin E is controlled with Atmega PC2 pin. Register is clocked with PC1 and data is transferred with PC0 pin. Notice, that I used same data line (PC0) to control LCD RS pin. RS pin is controlled in this way: after 8 bits are sent to shift register, then enable data line by setting ‘1’ (PC0) without clocking and after this LCD E pin is strobed. For more details take a look at my source code at the end of article. If there is any questions, don hesitate to ask. Source code:3 Wire LCD interface to ATMEGA

Continue reading