Adding a cheap LCD to your PC is a popular diy project for many beginners in electronics. The parallel port however, is dead. It's obsolete. It's big...ugly and just awful. The solution? Add a USB interface to your existing LCDs. The circuit interfaces to a standard HD44780 compatible LCD and emulates the CrystalFontz serial protocol over a virtual COM port created by the FTDI chip. This enables you to use already existing software to speak to the LCD, for example the popular program LCD Smartie. The circuit uses an AVR microcontroller, the tiny2313, and a USB chip from FTDI. The usb chip creates a virtual COM port on the computer. It has an external EEPROM programmable via USB to store information and settings. You can for example have the chip report back the name of your project when you plug it in. Very neat.
The backlight and contrast can be controlled from the computer. They are each connected to one of the PWM outputs on the AVR. Since the CrystalFontz protocol support software control of contrast and backlight, this seemed like a nice feature to add. Only LED backlights are supported, no EL backlights. The backlight can be powered from the USB port if its current draw is less than about 420 mA. If you need more, an external supply can be connected.
This is the schematic of the circuit. It's made in EAGLE PCB. Click to enlarge.
Board top and bottom:
Current limiting resistor R6 is only necessary if you want to power your backlight via the USB port. If you are doing so, +5V and GND to the backlight can be taken from the AVR ISP connector. Just connect a wire from the ISP connector to JP1 (the backlight supply connector). If you are using an external supply for your backlight, connect that to JP1 and replace R6 with a piece of wire. Note that the ceramic resonator connected to the AVR is there for a reason. Do NOT use the internal RC oscillator! Its frequency stability is very poor. Oh, and remember to set the fuses to use an external crystal and also unprogram the CKDIV8 fuse. The byte value to set the fuses (low byte fuses!) is 0xEE.
|R6||10 Ohm (optional, se note above)||0204/7|
|Q1||BC337 (and NPN will do, just check max current)||TO-92|
|XC1||6 MHz resonator (Murata CSTCC6,00MG-T)|
|XC2||8 MHz resonator (Murata CSTCC8,00MG-TC)|
|JP1||1x2 pin header (backlight supply)||2.54 mm pin distance|
|JP2||1x16 pin header (LCD header)||2.54 mm pin distance|
|JP3||2x3 pin header (AVR ISP)||2.54 mm pin distance|
The code is written in C and compiled on AVR-GCC. I have implemented as many of the CrystalFontz functions as is necessary to make the display work with LCD Smartie. There are still a few commands left to be implemented. If you download the source and implement them, feel free to email me () and I'll update the files. You will need to make adjustments in the source if your display size is something other than 20x4. You can also program the EEPROM connected to the FTDI chip using their Mprog utility. You will also need drivers for the FTDI chip. There are drivers available for nearly all modern operating systems.
AVR source code
EAGLE schematic and board layout files (EAGLE PCB can be found at the Cadsoft website)
Photos of my finished circuit.
Visitors since 22/2-05: