Tiny Project: Connect a Hitachi-compatible LCD to the PC via USB

Time for the second Tiny Project. This time, it is the text based LCD that got some nice treatment. These displays are rather common, displays anything from 1 x 8 up to 4 x 40 alphanumeric characters and are cheap and easy to find. That's why these LCD's are that common in various home projects. PC case modders have been using these for a long time, but there is a drawback with these displays: they need a parallel port to work as the interface is parallel (4/8 bits + three control signals). This makes it rather boring to install these in a PC with all wires needed and today, many motherboards does not even have a parallel port! But USB-ports are all over the place, so why not try to hook it up there instead?

That's what this tiny project is all about: making an USB->LCD converter. The idea was found when reading the Project-section of the swedish forum for electronic enthusiasts, Elektronikforumet. A member called PHermansson did just what I'm talking about. He was using the design from bit-tech.net created by ch424 as seen in this thread. And why invent the wheel again, so I did the same. What I did was to design a tiny PCB that could make the usage much simpler to use and compact as much as possible.

When I was at it, I did the boart somewhat more generic, making a few more pins of the PIC available. This will not limit the PCB to just the LCD application. Also, the rotary encoder in the original design aren't put at the PCB, but the three connections with their pull-ups are all there. The PCB is double-sided and does have a full ground plane at the solder side.

The usage of the board is easy. The firmware for the PIC18F2550 could be found at the bit-tech link below (and so the driver needed for the USB). To program the PIC, you must have a suitable programmer (for example the Wisp628/648) and a prototype deck to make a temporary connection to the programmer. There is no ISCP-header at the board (to save space). The board itself aren't hard to put together. All components except for the resistors (not R2) are 1206 SMD types. Everything else are hole mounted. Using a socket for the PIC is strongly recommended. The large resistor R2 is marked 10 ohm, but it must be adapted to the backlighter of your display. For some LCD's, 10 ohm will make the backlight too weak. The transistor marked with BC547X could be almost any NPN small signal transistor that are similar to a BC547A/B/C. It is only used as a switch, so the type aren't critical.

To use the final product, you must have a driver/inf-file available when plugging it in. It is also available at the bit-tech thread. This will create a new serial port in your PC. Use the Device Manager to find the COM-number it got (the driver will show "Microchip" in it's detailed description). To control the LCD from the PC, you must have some software. LCDSmartie is the one that is recommended. Set the program to use it as a Matrix Orbital serial LCD.

This coverter works only with LCD's using the Hitachi HD44780 or the KS0066U controller. The display size is limited to maximum 4 x 20 character models (4 x 40 can't be used).
Putting it together

This section is for those who bought the USB->LCD converter as a kit. It will give some help on the way of assembling it. In the kit, following parts should be included:

Part Value Comment
R1 10k (103) SMD, 1206
R2 0.5R - 10R Must be adjusted to the backlighter of LCD
R3 4k7 (472) SMD, 1206
R4 22R (220) SMD, 1206
R5 22R (220) SMD, 1206
R6 10k (103) SMD, 1206
R7 10k (103) SMD, 1206
R8 10k (103) SMD, 1206
C1 100nF (104)  
C2 100nF (104)  
C3 33pF  
C4 33pF  
C5 220nF  
C6 100µF/16V  
P1 10k trim Contrast adjustment for the LCD
X1 4.0000 MHz HC49/4H Low profile crystal
U1 PIC18F2550-I/SP Program it with the code from the Bit-tech thread.
T1 BC547B Transistor type not critical - any similar type will work.
J1 16-pin header Connects to LCD. Single row, 2.54 mm spacing.
J2 8-pin header For own experimentation. Single row, 2.54 mm spacing.
J3 3-pin header For rotary encoder. Single row, 2.54 mm spacing.
J4 Type B USB PCB-mounted USB connector.
B1 Button ALPS pushbutton series HH, 6 x 6 mm (type SKHHAJ).

Some special things to think about before assembling the board:
Component side Solder side

The easiest way to start the assembly of the PCB is to solder all the SMD resistors at the solder side of the board. A pair of tweezers is useful when placing these tiny parts in place. Put some solder first at one of the pads, then place the component and complete the soldering of the first end. When fixed, solder the second end. The rest shouldn't be any problem as these parts are hole mounted and placed at the component side. Start with the smallest parts (C1 - C4), followed by the bigger ones and finish it off with the connectors. Use a socket for the PIC (U1). The connection between the board and the LCD depends on the final application. A piece of flat cable works fine for example.

The cable for USB could be connected in two ways: either via a PCB-mounted USB type B connector or by soldering the USB-cable directly at the PCB. The USB-cable lead colors are: The picture below shows where to solder the cable ends:



Please note that when using a USB-connector instead of cable direct connection, be aware of the solder points shown above aren't in touch with the metal frame of the connector. Use a piece of tape or something similar and cover the solder pads before mounting the connector.

When the board is completed, check all solderings so they are clean and proper done. Use a multimeter to check that the power lines aren't short circuit (measure at the pins of C6 for example). When this is done, it is ready to be connected to the computer. The needed driver cound be found in the Bit-tech-thread (see links above). To use the LCD, download a suitable program (for example, LCDSmartie) and configure it as an Matrix Orbital serial LCD. Select the COM-port created by the driver installation (you can find it in the Device Manager, in the settings you should see Microchip Technology Inc) and set baud rate to 9600 bps.

Board LCD Pin PIC port Function
1 GND   Power ground
2 VCC   +5 V power
3 VLC   Contrast adjust (0 - 5 V)
4 RS RB6 Register Select
5 R/W RB5 Selects data direction (read or write)
6 E RB4 Enable
7 D0   Not used
8 D1   Not used
9 D2   Not used
10 D3   Not used
11 D4 RB0 Data bit 4
12 D5 RB1 Data bit 5
13 D6 RB2 Data bit 6
14 D7 RB3 Data bit 7
15 LED+   LED Backlighter VCC (+5 V)
16 LED-   LED Backlighter control via R2 and T1



Some pictures: