Graphical LCD controlled by only 2 wires

Graphical display controlled with only 2 wires

Programming a micro controller is much easier if you can do debugging. How ever this is often not available or only very limited. I usually debug my applications with a display. This way I can easily output numbers and strings in real time. The example below shows how to control a graphical 128×64 pixel display on only 2 signal wires. This can be useful if you have only 2 output pins left on your micro controller. I tested a MG12064E-SRY1 as well as a LXG128X64STY, but it should work with most graphic displays.

The data is clocked out serially and moved into a shift register. This then converts the data into a parallel signal which can be understood by the display. It took me a while to get a way to tell the display when the data is ready.It appeared that there has to be a little delay between getting the data ready and rising the display enable line. To solve this, I use an RC-Network. Usually a clock pulse is only about 250 ns long. To trigger the enable signal, I extend the pulse to 2.5 us. The complete time to transmit one byte is around 22 us:

Visualisation on an oscilloscope: Clock signal (yellow) and data signal (green)

To send a character you will need around 5 bytes, depending on the font map you are using. The source code which I provide below currently only supports a 8×5 font and some basic letters of a smaller font (to save program memory). Other font maps and graphic functions can easily be added. There are many complete libraries available on the web, i.e. on www.mugui.de (german).

Hardware

All you need is a display,  serial shift register ic’s (74595), an inverter 7404 and a few resistors and capacitor:

Schematics

Download

The schematic (eagle file) as well as an example software code can be downloaded here:

Controll a graphic display with only 2 wires
31.4 KiB
181 Downloads
Details...

This entry was posted in Electronics, Programming. Bookmark the permalink.
Comments
  • Post a comment

    Threaded commenting powered by Spectacu.la code.

  • Sten August 16, 2011 at 16:15

    Hi, I’ve found your website through Google. I am looking for datasheet of LXG128X64STY lcd. Do you know where could I download it or at least what controller chip is used?
    Thanks.

    • George August 16, 2011 at 20:18

      I also never could fine a datasheet for the LXG128X64STY, but it is compatible to the MG12064E-SRY1. If you need the datasheet for that, please let me know.