Connect LCD to Atmega using 3 wires
After I implemented interfacing LCD to ATmega8 using 2 wires http://www.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’s 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
Blogsphere: TechnoratiFeedsterBloglines
Bookmark: Del.icio.usSpurlFurlSimpyBlinkDigg
RSS feed for comments on this post | TrackBack URI for this post
New on WinAVR Tutorial
Running TX433 and RX433 RF modules with AVR microcontrollers,Sometimes in embedded design you may want to go wireless. Might be you will want to log various readi …Programming AVR ADC module with WinAVR,Most of AVR microcontrollers have Analog to Digital Converter (ADC) integrated in to chip. Such solut … |
New on WinARM Tutorial
What are differences between WinARM and WinAVR,Everyone who is working with AVR microcontrollers knows this powerful tool – WinAVR (http://win …LPC2000 watchdog timer,As in all microcontrollers watchdog timers purpose isto reset microcontroller after reasonable amount … |

September 30th, 2006 at 6:37 pm
there are any problem in using 74LS164 instead 74LS164?
tks,
Christiano
October 2nd, 2006 at 1:28 pm
There shouldn’t be any problems with that.
March 27th, 2007 at 1:26 pm
What is the value of R2?
March 27th, 2007 at 2:19 pm
In my actual circuit I have used 10k. This may vary I think from 4.7k as it is Pull-Up resistor only.
March 30th, 2007 at 10:01 pm
Which is the value of r2?
April 20th, 2007 at 4:06 pm
Why the lcd only writes a series of squares instead of the word test?
July 13th, 2007 at 2:08 pm
Why you didn’t use SPI on ATMega ?
connect SCK,MOSI to 74*164 inputs, D4..D7 and RS to outputs.
and i.e. SS pin to EN - 3 lines - lcd in 4bit mode :)
it’s much easier to program it (IMHO)
Best Regards
Vaitek
July 13th, 2007 at 11:36 pm
Using SPI s a good idea. Maybe I will try to simulate this version. Only one disadvantage of such connection is that hardware is tied to SPI pins instead to any MCU pins. I bet programming should be more easy using SPI.
February 8th, 2008 at 2:33 pm
can just use any LCD or must be the one you are using?
February 8th, 2008 at 4:27 pm
Any standard alphanumeric LCD based on HD44780 controller.
February 17th, 2008 at 4:05 am
I’m need PB3, PB5, PD5 to connect LCD. Help me.
February 19th, 2008 at 4:52 am
Why my lcd write UESU! instead of TEST!.I use od-dm1601b,tks.
February 19th, 2008 at 11:29 am
Do you use standard LCD? Are all connections made properly? Because this circuit should work properly - tested myself.
March 31st, 2008 at 9:26 am
hey kindly help me
i have atmega 8 and displaytech 16*2 lcd ……i want to display some text when the ir sensor connected to its adc port is interuppted.how to go for it
May 7th, 2008 at 2:51 am
Hi,
Does the shift register have to be controlled by the adc pins on the atmega or can another port be used?
Thanks
May 7th, 2008 at 10:52 am
You can use any I/O pins for this. Of course you need to do changes in software definitions.