GenBoard/BuildProcedures/LCDconnect

GenBoard/VerThree : electrical connecion of standard HD44780 LCD (like LCD 204B, regardless of color and size)

A Nice drawing can be found on MembersPage/PeterJensenDisplay .

Orientation of JP_LCD pins on GenBoard/VerThree

jp_lcd_pinout.jpg

Data sheet for the 4x20 LCD display sold in the WebShop

The DSUB9 old pinout was phased out in favor of the new pinout appr. 2005.May (the WebShop text for the assembled ECM was always authoritive). If in doubt, measure the supply voltage between the relevant pins to be sure. This table will only print well in landscape mode (bad in portrait mode).

recommended colorJP_LCDLCDfunctionDB9DB25 Note
brown 2 1 Gnd 5 5 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 +5V Vcc 1 1pin10 is in the right-upper pin on v3 LCD header
yellow9 - -8V -14 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 9 18 data or cmd
orange7 5 R/W 6 15 data dir.
purple8 6 Enable 2 2 latch control
green611Databit4 3 3  
grey512 Databit5 716  
darkblue413 Databit644  
black314 Databit7 8 17 
 -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 Contrast


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

The -8V (JP-LCD9, yellow wire according to GenBoard/BuildProcedures/LCDconnect standard colors) for contrast is not needed for most LCD (only a very few green LCD with black frame needed negative, appr -3V contrast). The -8V signal is not available on the DSUB9, so the yellow wire will not be connected in the DSUB9 housing - hotmelt it so it does not contact anything). The DSUB25pin14 has the -8V signal, but, as I said, not needed for the blue LCD.

When bought from WebShop, the crew would warn of LCD that requires negative contrast (this type is not sold these days). Such an LCD will not be viewable at all with -2V .. 0V on contrast.

LCD with -3V contrast

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:

( (+5V * 1/4.7) + (-8V * 1/3.0)) / ( 1/4.7 + 1/3.0) =  -2.93V

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)


When LCD needs negative contrast, use a DSUB15 or DSUB25, since the DSUB9 does not have enough pins for both negative contrast and busypoll (R/W) signal

The non-recommended way to make negative contrast work with DSUB9 (unfortunately busypoll disabled => not optimal)


Connecting keyboard through DB25

I propose this pinout that I've used on four boards now, along with the LCD pinout described above:

See also [[Manual: Detailed.Central.Keyboard.Install]]

JP_PS1DB25pinoutMini DIN6Function
1224Vcc
2233Gnd
3241Data
4255Clock

See also: