[ Homepage ]
[ What's new ] [ Contact ] [ Sitemap ] [ Forums ] [ Top Menu ]
[ Products ]
[ Documentation ]
[ Downloads ]
[ Sales ]
[ JK Alliance ]
[ FAQ ]
[ Proven Solutions ]
           

LCD Programming Information

DRIVERS

LCD_LF.ZIP (LogicFlex single board computer and LogicFlex-EPX control system), LCD_EX.ZIP (Flashlite 386Ex single-board computer) and LCD.ZIP (Flashlite-V25 single-board computer) are drivers for one or two LCD's connected to the Flashlite's J7 (386Ex) or J5 (V25) port. The driver supports standard alpha-numeric LCD displays using the Hitachi HD44780A controller chip. Data sent to LPT1 or 2 is re-directed to the LCD displays. Documentation and source code is included along with a demo application in Quickbasic.

POSITIONING CHARACTERS ON THE DISPLAY

A table of position codes is shown below. Use these codes to put a character at a specific location. The values are given in decimal and in hex.

128 129 130 131 132 133 134 <135 136 137 138 139 140 141 142 143 144 145 146 147
80h 81h 82h 83h 84h 85h 86h 87h 88h 89h 8Ah 8Bh 8Ch 8Dh 8Eh 8Fh 90h 91h 92h 93h
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
C0h C1h C2h C3h C4h C5h C6h C7h C8h C9h CAh CBh CCh CDh CEh CFh D0h D1h D2h D3h
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
94h 95h 96h 97h 98h 99h 9Ah 9Bh 9Ch 9Dh 9Eh 9Fh A0h A1h A2h A3h A4h A5h A6h A7h
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
D4h D5h D6h D7h D8h D9h DAh DBh DCh DDh DEh DFh E0h E1h E2h E3h E4h E5h E6h E7h

For Example, when using our LCD driver, the following basic program will initialize a 4x20 LCD and print a test message on lines 3 and 4 starting in the 13th column of the display.

open "lpt1" for output as #1    ' set up LPT1 for output
print #1,chr$(160);chr$(40);    ' 4 bits, 4 lines, 5x7 matrix
print #1,chr$(160);chr$(12);    ' display on, cursor and blink off
print #1,chr$(160);chr$(6);     ' increment cursor, no display shift
print #1,chr$(160);chr$(1);     ' clear and home display
  
print #1,chr$(160);chr$(&hA0);  ' position cursor at line 3, row 13
print #1,"HELLO"                ' output text on LCD
print #1,chr$(160);chr$(224);   ' position cursor at line 4, row 13
print #1,"WORLD"                ' output text on LCD
NOTES

In the above example, the 160 is a command byte sent to the LCD driver. This must be sent as a byte, not as the characters 1, 6, and 0.

When using a 4x20 display, it is important remember that the LCD has 2 control chips. One chip displays information on lines 1 and 3 of the LCD, the other displays information on lines 2 and 4.

Most of the problems we encounter with LCDs are due to incorrect wiring. Carefully verify the wiring between the JK microsystems embedded computer and the LCD if you have trouble.

Although our LCDs will function with the contrast pin tied to ground, the contrast might not be the best for a given viewing angle. To adjust the contrast, install a 10k potentiometer between VCC and ground and connect the wiper to pin 3 of the LCD. Be sure the ground connection is at Pin 1.

See our C programming page for more examples.

Home | Products | Company | Order
Copyright © 1998-2003 JKmicrosystems, Inc.