GenBoard/BuildProcedures/LCDconnect (2005-04-13 16:42:58)

GenBoard/VerThree : electrical connecion of standard HD44780 LCD (like LCD 204B)

Data sheet for the 20x4 LCD display sold in the WebShop [Displaytech LCD 204B]

recommended colorJP_LCDLCDfunctionDB9Note
brown21 Gnd6 pin2 is not in the leftmost column on the v3 LCD header: Leftmost column is pins -1,0 that are elsewhere in the schematic. Also connect the cable shield to GND signal, but only at the DB9 end (not at the v3.2 board end)
red102 Vcc 1 pin10 is in the right-upper pin on v3 LCD header
yellow9 - -8V - optional: negative from MAX 232 thru R112. Some LCD like slightly negative potential on contrast pin (LCD pin3) for which this can be used. Try the variable resistor method below. If there is no viewability with 0 or positive contrast votlage, or best result is with variable resistor fully set to GND (not a bit of +5V applied), you can try to devise a nagative contrast voltage, starting from -8V instead of +5V for slightly better result. See LCD negative contrast section below
-- 3 Contrast - Solder a 2k2 .. 4k7 .. 10k variable resistor between GND and +5V, with middle terminal to LCD pin3. Set variable resistor for best contrast (it will be near GND). After finding best contrast you can replace variable resistor with matching resistor values. Most LCD like a 470 Ohm .. 1k to GND and 5k6 .. inf towards +5V
white1 4 RS 3 data or cmd
orange7 5 R/W 7 data dir. If configuration says not to use busypoll, LCD pin7 can be connected to constant GND (LCD pin1) on the LCD side (which means data direction is always GenBoard => LCD), freeing a signal: DSUB pin7. This is useful when an extra signal is required for the LCD with negative contrast. Note that this breaks the DSUB9 pinout compatibility, so take care if using both types.
purple8 6 Enable 4 latch control
green611Databit4 5  
grey512 Databit59 
blue413 Databit68 
black314 Databit72 
 -15 Backlight+- You can connect it to VCC with a 22..100 Ohm resistor. Note that voltage drop of backlight LEDs (2 in series?) is sometimes over 4V
 -16 Backlight-- This can be connected to GND via a manual switch. Alternatively it could be switched with a p259 pin, or with a small NPN near the LCD: the NPN base can be controlled through a 1k..2k2 resistor by a free pin of the s259 (allowing software-PWM for backlight dim)

LCD that requires a negative (appr. -3V) contrast voltage.

When bought from WebShop, the crew will warn of this. LCD's that require negative contrast voltage usually have superior contrast. Such an LCD will not be viewable at all with -2V .. 0V on contrast.

This is how I made the -3V LCD work

The way it works - for the curious:

The setup for the contrast voltage is effectively a voltage divider from 2..3 resistors:

The resulting voltage is the weighted average of the voltage "pulls". The weights are the reciprocal of resistor values (1/R), see example below.

Resistor divider example:

4k7 internal pullup inside the LCD towards +5V and onboard R112=3k pull towards -8V the weights are 1/4.7 and 1/3:\nÿ1ÿ

Note that any resistor that is not there (eg. unsoldered) is infinite resistance, so the weight is 1/inf = 0 (no need to calculate with those)


See also: