USB interface for parallel LCDs

FT232BM ATtiny2313

USB interface for parallel LCDs

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.

Schematic and board layout.


Click to enlarge


Component list.

Name

Value

Package

R1

470 Ohm

smd 1206

R2

1 kOhm

R3

27 Ohm

R4

27 Ohm

R5

1.5 kOhm

R6

10 Ом (опция)

 

R7

4.7 kOhm

smd 1206

R8

470 Ohm

R9

2.2 kOhm

R10

10 kOhm

R11

1 MOhm

C1

100 nF

C2

10 nF

C3

33 nF

smd 0805

C4

100 nF

smd 1206

C5

100 nF

C6

10 µF

CT6032

C7

100 nF

smd 1206

IC1

FT232BM 

LQFP-32

IC2

ATtiny2313 

SO-20

IC3

93LCS56SN 

SO-08

Q1

BC337

 TO-92

XC1

6 MHz resonator
(Murata CSTCC6,00MG-T)

 

XC2

8 MHz resonator
(Murata CSTCC6,00MG-T)

 

CON1

USB-B connector

 

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.

Source code.
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.

Source code fof AVR microcontoller: USBLCDsource.