# # $Id: README.HD44780,v 1.3 2001/03/14 15:14:59 reinelt Exp $ # This is the README file for the HD44780 display driver for lcd4linux This driver supports all display modules based on the Hitachi HD44780 chip. These displays are made by different manufactures, and come in various sizes. At least the following types are known to work: DataVision DV16244: 2 lines by 16 characters Nan Ya NLC 08x2x06: 2 lines by 8 characters The displays are connected to the parallel board (see Wiring below), and are quite timing-critical. There's no way to delay a usermode program under Linux for e.g. 40 usec, so we have to do busy-waiting. This is done in a delay loop, which had to be calibrated (see Configuration below). Since 0.98 there are two new delay loops, one based on the processor's TSC (Time Stamp Counter), one based on gettimeofday(). lcd4linux decides automatically which one to use (it prefers the TSC method, but falls back to gettimeofday() if neither the tsc flag nor the MHz value is set in /proc/cpuinfo). The driver knows of two ways of controlling the parallel port: The (old, ugly and unportable) raw programming of ports, and the new, cool, great ppdev() style. You decide which one to use by specifying either a hexadecimal value or a device file with the 'Port' entry in the config file. Note that the old port programming only works with standard ports (0x3f8, 2f8,...), but not with PCI parallel port cards. ppdev requires kernel 2.4. The configure script detects if you have the required include files, and deactivates ppdev if they are not there. You should use ppdev whenever possible. Raw port access may be dropped someday. The driver supports vertical, horizontal and split bars (two independent bars in one line), all bar types can be used simultanously. As the displays only have 8 user-defined characters, the needed characters to display all the bars must be reduced to 8. This is done by replacing characters with similar ones. To reduce flicker, a character which is displayed at the moment, will not be redefined, even if it's not used in this run. Only if the character compaction fails, this characters will be redefined, too. Configuration: The driver needs the following entries in lcd4linux.conf: Display: HD44780 Port: either the hexadecimal address of the parallel port (e.g. 0x378) or a ppdev device (e.g. /dev/parports/0) Size: [columns]x[rows] e.g. "16x2" #ifdef USE_OLD_UDELAY Delay: calibration of the delay loop, loops per microsecond THIS IS NO LONGER NECESSARY! It is very important to use a correct delay value, otherwise you will get only junk on the display. lcd4linux has a switch '-d' where it helps you to find the correct value. Run 'lcd4linux -d' several times on a otherwise idle machine, and use the maximum value. If you encounter display problems, increase this value. But don't take it too big, lcd4linux will get slow, and you're burning CPU cycles. The delay value is defined by your CPU model and clock frequency (it looks like it's your 'BogoMips' value divided by 2, because we use a similar delay loop than the kernel does). Here are some examples: Pentium MMX, 133 MHz, 106 BogoMips: 54 Pentium MMX, 166 MHz, 333 BogoMips: 166 Celeron, 333 MHz, 333 BogoMips: 166 Pentium III, 600 MHz, 600 BogoMips: 300 AMD Athlon 1010 MHz, 2012 BogoMips: 505 #endif Wiring: There are two basic wiring modes for HD44780-Displays: a 4 bit mode (used by lcdproc) and a 8 bit mode (used by most other packages). At the moment we only support the 8 bit mode, but I'm working on the 4 bit mode, too. The main difference is that the 8 bit mode transfers one byte at a time, but the HD44780 needs some control signals, so some of the parallel port control lines are used for this. The 4 bit mode uses only 4 bits for data (so a byte has to be transferred in two cycles), but you can use the other 4 bits for the control signals. Normally a HD44780-based display have 14 or 16 pins, where pins 15 and 16 are used for backlight. Power (+5V) must be supplied via pins 1 and 2, be careful not to change polarity, you will destroy your display! Pin 3 is used to control the contrast, you can either hardwire it to GND (pin 1) or place a potentiometer (10k-20k) between pins 1 and 2, and connect pin 3 to the slider. Note that the data bits are called DB0..DB7 on the display, but DB1..DB8 on the parallel port! Here comes the wiring diagram for the 8 bit mode: --- Display --- --- DB25 --- --- comment --- Name Pin Pin Name GND 1 18 GND GND of power supply, too! +5V 2 - power supply only LCD drive 3 - see above RS 4 14 Auto Feed register select, 0=data, 1=command R/W 5 18 GND hardwired to 0, write data only Enable 6 1 Strobe toggled when data is valid DB0 7 2 DB1 data bit 0 DB1 8 3 DB2 data bit 1 DB2 9 4 DB3 data bit 2 DB3 10 5 DB4 data bit 3 DB4 11 6 DB5 data bit 4 DB5 12 7 DB6 data bit 5 DB6 13 8 DB7 data bit 6 DB7 14 9 DB8 data bit 7 +5V 15 - power for backlight GND 16 - power for backlight 10-13 not connected 15-17 not connected 19-25 not connected Wiring diagram for 4 bit mode: soon to come! d='n107' href='#n107'>107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432