Hitachi HD44780 LCD Screens

One thing I found out recently, to my surprise, is that almost any character-based LCD screen is based on the same controller chip. They come in all different sizes from 8x1 to 20x4. Some quick facts real quick. The most characters a 44780 can control is 80. They do make larger screens but what they basically have is two seperate controllers that share the same data lines but have their own seperate "enable" lines. (explain more on this later) All of these have the same 14-wire interface and some have 16 if they are backlit. They also have 8 programmable characters. These things are fairly simple to control. In fact, you could control it without a computer at all. You could quite literally hook up 8 toggle-switches to the data lines, one toggle switch for the command/data line, and a pushbutton on the enable line. You could flip the one switch to tell if the data send was going to be a command or screen data, then adjust the 8-bits to be whatever byte you want to send it, then push the enable button to key that data into the screen. The screen can be run just about as fast or slow as you want.

So what do I need with these things for my Shuttlecraft? Well, I've decided to have an embedded computer system. At this point I've decided on a Commodore 64. It will read sensor data from a variety of sources and report back that information on the screen(s). Just some of the data it will monitor will be the indoor/outdoor/hull temperatures, the state of many of the toggle switches on the main power panel, the door sensor, the alarm keypad, and many other things as I think of them. I didn't want the data limited to just one screen, so I thought I could place these LCD screens throughout the craft in various places reading different information. Some of them might have buttons next to them allowing to change the data being displayed at that location. although I have a 16x2 LCD pictured here, I've been working with a backlight 20x4 and more than likely this will be what I use.

The Hitachi type screen can be connected easily to the C64's user-port with basically no electronics. In fact, you can connect up to two of them just to the user-port in 4-bit mode. However, I need the user-port for other stuff and so I'll be using the cartridge port. Later on, I'll post schematics here for my cartridge interface. It will be part of the same board which will house my non-volatile RAM chip which will store my program so that the system will start running it on power-on.

After trying many ways to make these things work on the Data/IO bus, I gave up and decided to use the 6526. Actually, that sort of gives a few advantages. First of all, if I run it in 4-bit mode then a RJ-45 port and regular CAT-5 cable has just the right number of pins to carry the 4 data bits, register select, chip-enable, +5V, and ground. So I thought that would be a good way to interface my screens to things. Although I plan on using many more than just 2 screens, I thought as a starter it would be good to have 2 such ports on my C64. So I created two of them on the back of the unit (see pictures below) and they all share 7 wires in common. The only wire that is different between them is the chip-enable. That way all the screens receive the same data but ignore it unless that particular screen has its enable pin set. You can only run 3 screens this way from the user-port. However, I plan on piggy-backing another 6526 chip in there and mapping it to $DE00 so I can have an additional 16-lines of general purpose I/O.

My goal now is to create several small "monitors" that have stands and look nice but are based on the character LCD modules. I'm currently building such a thing from a backlit 20x4 character screen. It should look nice when finished. And it will have a simple RJ-45 jack in the rear. It will also have two slide-potentiometers for contrast and brightness.

These are two RJ-45 jacks I created in the back of my C64. They are held in by epoxy and quite strong. Someday I'll fancy it up and make it look nicer.
This is what it looks like from the inside.
This is how I connected the wires to the user-port.. instead I went straight to the 6526.
This a 16x2 character LCD hooked up through one of the new ports in the back.

The next thing for me to do is create a much more sophisticated driver software. I haven't quite made up my mind how to do it. The software needs to be able to handle several different screens and also different sizes of screens. Since I have the read/write pin grounded on the screen it can only be written to, and not read from. So I'll probably need to allocate some RAM for each screen to store as a buffer of what is supposed to be there. That way I can do scrolling and stuff like that. Another thing I "might" consider doing is allowing the driver to map a certain place on your VIC-II screen memory and use the interrupt routine to keep the LCD displaying the same thing. So that way the driver would be easy to interface with other software or even BASIC by just making sure you didn't print outside of the range of the screen.

Eventually, I'll be retro-fitting a 1541 motherboard to run these screens too. I want my software to run on any 6502 based system with a 6526 chip. The end-goal is really (besides my shuttlecraft) to create my own 6502 microcomputer and I want to have good functioning I/O routines before I go there. So this interface I created is perfect for that.


Go Back