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.

3WireLCD.png

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 …

16 Responses to “Connect LCD to Atmega using 3 wires”

  1. Christiano Says:

    there are any problem in using 74LS164 instead 74LS164?

    tks,
    Christiano

  2. scienceprog Says:

    There shouldn’t be any problems with that.

  3. Roberto Says:

    What is the value of R2?

  4. scienceprog Says:

    In my actual circuit I have used 10k. This may vary I think from 4.7k as it is Pull-Up resistor only.

  5. Roberto Says:

    Which is the value of r2?

  6. lello Says:

    Why the lcd only writes a series of squares instead of the word test?

  7. Vaitek Says:

    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

  8. scienceprog Says:

    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.

  9. someone Says:

    can just use any LCD or must be the one you are using?

  10. scienceprog Says:

    Any standard alphanumeric LCD based on HD44780 controller.

  11. z80 Says:

    I’m need PB3, PB5, PD5 to connect LCD. Help me.

  12. sghiddo Says:

    Why my lcd write UESU! instead of TEST!.I use od-dm1601b,tks.

  13. scienceprog Says:

    Do you use standard LCD? Are all connections made properly? Because this circuit should work properly - tested myself.

  14. ashutosh Says:

    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

  15. Jimmy Says:

    Hi,

    Does the shift register have to be controlled by the adc pins on the atmega or can another port be used?

    Thanks

  16. scienceprog Says:

    You can use any I/O pins for this. Of course you need to do changes in software definitions.

Leave a Reply