# # # # # # # ## ### #
______ | ____| | |__ | __| | | |_|
_______ ( ____ ) | ( )| | (____)| | _____) | ( | ) |/
_ | | | | | |___ |_____|
### #### ## ## ## ## ## ## ###### ## #####
IMPORTANT: enter the case-INsensitive alphabetic (no numbers) code AND WRITE SOME SHORT summary of changes (below) if you are saving changes. (not required for previewing changes). Wiki-spamming is not tolerated, will be removed, so it does NOT even show up in history. Spammers go away now. Visit Preferences to set your user name Summary of change: '''GenBoard/VerThree : electrical connecion of''' standard HD44780 '''LCD''' (like ''LCD 204B'') Data sheet for the 20x4 LCD display sold in the WebShop [http://www.displaytech.com.hk/pdf/char/204b%20series-v12.PDF Displaytech LCD 204B] ||'''recommended color'''||'''JP_LCD'''||'''LCD'''||'''function'''||'''DB9oldpinout'''||'''DB9proposedpinout'''||'''DB25pinout'''|| '''Note'''|| ||brown||2||1|| Gnd||6|| 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)|| ||red||10||2|| Vcc || 1 ||1||1||pin10 is in the right-upper pin on v3 LCD header|| ||yellow||9|| - || -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 || ||white||1|| 4|| RS || 3 ||9 || 18|| data or cmd|| ||orange||7|| 5|| R/W|| 7|| 6|| 15|| 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. || ||purple||8|| 6|| Enable|| 4||2 ||2 || latch control || ||green||6||11||Databit4 || 5 ||3 ||3 || || ||grey||5||12|| Databit5||9|| 7||16 || || ||darkblue||4||13|| Databit6||8||4||4 || || ||black||3||14|| Databit7||2|| 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)|| * '''Note that in the sch the 2*6 LCD connector (don't mix it with the 2*6 ISPI connector: the ISPI is closer to the AVR) is split to 1*2 and 5*2. The 1*2 is close to the edge of the PCB. Very confusing if you don't pay attention, since the 1*2 header pin numbers would become -1 and 0, if we keep the 1..10 numbering of the 5*2'''. If you look at the board in eagle, it'll be obvious. But a renumbering wouldn't hurt. * the LCD has a 2nd connector for mounting convenience, numbered 17 .. 32. It is the very same as 1..16, just add 16 to the pin number. It is enough to connect either one. * LCD contrast: there are places onboard for setting LCD contrast bias, but if you want to swap between different makes of LCD, setting this with soldered R at the LCD might be better, This resistor isn't mounted when you get the board * the DB9 column is our standard that we sometimes use for connecting the LCD: eg. male DB9 on endplate, female DB9 on cable connected to LCD. * Orientation of pin's at GenBoard/VerThree: [http://www.squirrelpf.com/msavr/files/Pinout.pdf apparently bad URL] * TODO: show the right pinheader on a retouched picture * While waiting for the retouched picture; [http://200sx.jagenheim.se/images/jp_lcd_pin.png this] should do. ---- '''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''' * I connected the RW signal to GND on the LCD side (to make place for the negative contrast voltage on the DSUB9 connector) * configure LCD not to use busypoll * applied JP_LCD pin9 (rightmost pin, under +5V) to DSUB pin7 instead of the RW * applied DSUB pin7 to LCD contrast pin3 * removed R169 from the board (was 1.0k). This is not absolutely necessary, but this allowed somewhat higher resistor values so less load on the -8V produced by the max232, so I removed it for the negative contrast LCD. I wouldn't have bother to remove it if my LCD were positive contrast. * after setting best contrast with a variable resistor, I applied onboard pulldown to -8V: R112=3.0k ** a good way is to use an onboard R112=2k7 and use 0..510 Ohm series resistor at the LCD, choosing the one from 0, 270 and 510 Ohm that gives best contrast (for that LCD.) ** note that there is no explicite pull to GND (which was R169) or pull to +5V (other than some internal pullup resistor in the LCD): just a pull to -8V resistor of sufficient value '''The way it works''' - for the curious: The setup for the contrast voltage is effectively a voltage divider from 2..3 resistors: * LCD apparently has a 4k7 pullup to +5V * R169, or "R169 substitute on the LCD side" pulls towards GND ** '''R169 recommended not solder on board, but near/on the LCD from GND (LCD pin1) to contrast (LCD pin3)'''. This makes it possible to have different resistor for another LCD (for exact adjust, without opening the v3 case). * R112 2.2k .. 3k3, recommended 2.7k (marked 272 or 2701) or 3.3k (marked 332 or 3301), solder on the board pulls towards -8V 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: <code> ( (+5V * 1/4.7) + (-8V * 1/3.0)) / ( 1/4.7 + 1/3.0) = -2.93V </code> 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: * GenBoard/LcdFaQ * LcdConnector Optional: Add document to category: Wiki formatting: * is Bullet list ** Bullet list subentry ... '''Bold''', ---- is horizontal ruler, <code> preformatted text... </code> See wiki editing HELP for tables and other formatting tips and tricks.