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:
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).
All you need is a display, serial shift register ic’s (74595), an inverter 7404 and a few resistors and capacitor:
The schematic (eagle file) as well as an example software code can be downloaded here: [wpfilebase tag=file id=16]