LCD Interface

Another update for anyone watching the page – 2/10/2012. There appears to be some timing issues with the LCD library I wrote – which have become apparent since I made teh delayMicroseconds() function more accurate. More updates on the page linked to below as well as some nre Fristing diagrams!

Update to this page – 11/7/2012: Decided to make a “proper” LCD library and add it into the wiringPi library. See here for full details.

Doing a bit of a tidy up, I found an old, but unused 16 x 2-line LCD text display module. Type: LMB162A. This has a fairly standard controller on it which accepts simple commands and ASCII text.

The interface can run in 4-bit mode or 8-bit mode. Since I had the GPIO pins, I decided to run it in 8-bit mode…

Problem No. 1: It’s a 5V device and the Pi is 3.3v… However most 5V logic will work when presented with a 3.3v signal…

Problem No. 2: The LCD controller is a read/write device, and if it were to ever try to write to the Pi, it would put 5v on the output pins… But who wants to read from it anyway, so I hard-wired the R/W pin to ground, so it was permanently in write mode – which also meant I needed one less wire from the Pi to the module.

So 8 data bits, a bit to tell it you’re writing a command or data, and a strobe bit. 10 GPIO pins needed. I used the first 8 general purpose IO pins and the 2 I2C pins set to output mode.

The LCD was powered from the 5V on the GPIO connector.

And after some simple software, it worked!

Note: New GIT Repository here

LCD on Raspberry Pi via GPIO

LCD on Raspberry Pi via GPIO

Now… Do I carry this on and make a general purpose LCD library as an extension to wiringPi, or just leave it as that…

-Gordon