Interfacing LCD's
Intro
|
Interfacing a LCD is not that tough to do, so we'll try to explain how to interface and use it for the GURU project.
Parts
- 1 Liquid Crystal Display (LCD) [BUY]
You need a HD44780 or compatible chip
- 1 diode - 1N4004
- 1 male DB25 connector
- 1 NPN Transistor - BC547
You'll only need this one if you want to turn on/off the backlight using your computer
- 1 resistor - 1k ohm
Also for backlight control
|

Display's we're using.
|
Schema & Hardware
If you don't need to control the backlight with your pc, you can ignore the circuit between pin 17 of the parallel port and pin 16 from the LCDisplay. In this case you can connect pin 16 of the LCD directly to GND.
You probably also don't want to use the 20k-pot meter since it's not useful anyway. You can connect pin 3 directly to GND for full font intensity
Software
Under construction
But for now you can use lcd-0.1.tar.gz to test the display.
Some technical information
pin 4 (Register Select): Activate for writing characters or keep it low when writing to control registers.
pin 5 (Read/Write): When activated the display is set to read, when low you can write to the display. Since you probably only write to the LCD, you could connect it to the +5Vdc power supply.
pin 6 (Enable): Used to latch the datapins 7-14 into the LCD. The display latches on the falling edge of the signal, so you've to drop it low, or since it's connected to the nStrobe signal of the parallel port, we have to activate the Strobe signal (which is bit 0 on the Control port).
Programming:
RS R/W B7 B6 B5 B4 B3 B2 B1 B0
0 0 0 0 0 0 0 0 0 1 Clear Display
0 0 0 0 0 0 0 0 1 X Return Home
0 0 0 0 0 0 0 1 D S Entry Mode Set
D: 0=direction -, 1=direction +
S: 0=no shift, 1=shift
0 0 0 0 0 0 1 D C B Display on/off
D: 0=disply off, 1=on
C: 0=cursor off, 1=on
B: 0=blink off, 1=on
0 0 0 0 0 1 S R X X Display or Cursor Shift
S: 0=cursor only, 1=both
R: 0=left; 1=right
0 0 0 0 1 D N F X X Set data interface
D: 0=4 bit, 1=8 bit
N: 0=1-line display, 1=2-line display
F: 0=5x7 dots, 1=5x10 dots
0 0 0 1 A A A A A A Set char gen RAM address
Lets you select one of 64
chars for loading a bit map
0 0 1 A A A A A A A Set display RAM address
Lets you select an address
in the display buffer. With
this you can write in a pos-
ition that is off the viewable
display.
0 1 B A A A A A A A Read busy flag, address pointer
If B=1, display is updating.
Also returns address of last
data transfer.
1 0 D D D D D D D D Write Data
Writes to Display if previous
instruction was SET DISPLAY
RAM ADDR. Writes to char gen if
previous instruction was SET
CHAR GEN RAM ADDR.
1 1 D D D D D D D D Read Data
Reads from Display if previous
instruction was SET DISPLAY
RAM ADDR. Reads from char gen if
previous instruction was SET
CHAR GEN RAM ADDR.
|