hd44780 LCD to i2c or smbus

I have an hd44780-compatibe LCD connected to Pentium II SDRAM and running lcdproc on it. No LPT port, no external cables. Everything is hidden inside PC.


Schematics

Everything existng seemed to be based on LPT or rs232 port. Only exceptions were PICs but in this case there was no software support for PC at all. Because there is a SMBUS (subset of i2c) available on every PC motherboard I decided to use it.

Schematics is here and board here. Files are in Eagle format. In fact I used Philips PCA9554 chip instead of PCF8574 which is older. They are PIN-compatible but software part differs a bit. I was not able to find Eagle library for right chip and was lazy to build one myself too.

It is all connected to SDRAM as shown here except there is not much sense to solder power lines to SDRAM when you have free floppy power connector available :P.

82B715 bus driver chip is not mandatory. I use it to extend SMBUS over longer distances and not needed if you are going to use LCD only.

Linux drivers for PCA9554

As there was no support for chip I used, I had to write new drivers. Looking around showed that PCA9539 driver already exists (similar chip) and I had to make improvements to it. Now it can recognize PCA9538, PCA9554 and can be modified to support PCF8574 and PCA9555 easily. Patch is here

After "modprobe pca9539" you should be able to turn LEDs on and off:

tonu@test: cat 0 > /sys/bus/i2c/devices/0-0027/direction
tonu@test: cat 0 > /sys/bus/i2c/devices/0-0027/output
tonu@test: cat 255 > /sys/bus/i2c/devices/0-0027/output

Driving LCD

This was most difficult task to make first time. After playing a while I got this code working. Next step was to hack it into lcdproc. Patch for lcdproc is here and config file is here.

tonu@test: ./configure --enable-drivers=hd44780
tonu@test: make