HD44780 display
Hitachi HD44780 compatibele LCD
Pinout
A HD44780 compatible display has 14 or 16 pins, depending whether it has backlight. For a working display, you need a minimum of 6 microcontroller ports: RS, EN and D4-D7.
Pin | Name | Description |
---|---|---|
1 | VSS | Ground |
2 | VDD | +5 volts |
3 | VLC | Contrast voltage, normally < 1V |
4 | RS | Register Select (high=Data write, low=Command write) |
5 | R/W | Read/Write (high=read, low=write) |
6 | EN | Enable: high pulse latches command or data |
7-10 | DB0-DB3 | 8-bit mode only: data/command bits 0-3 |
11-14 | DB4-DB7 | 8-bit mode: data/command bits 4-7, or both nibbles in 4-bit mode |
15,16 | AB,KB | (optional) Background light: anode, kathode |
Operation
The display can operate in both 8 and 4-bit mode. By default, it will start at 8-bit mode, so you need extra initialization before you can start bit banging per nibble.
For most of the things you do, you need to write either a command (instruction) or just data (text). Therefore, you need a write routine. RS (Pin4) determines the type (command/data), the rest is just nibbles and bytes ;)
Note: for a better timing, refer to table 6 (page 24 and 25) of the datasheet. Also, waiting on the the busy flag is recommended.
8-bit
Pin | Action | Description |
---|---|---|
EN | 0 | make sure chip is in normal operation |
RS | 0 or 1 | command->0 or data->1 |
D0-D7 | bits 0 to 7 | place byte on bus |
EN | 1 | latch the data onto the chip |
wait | > 450ns for the data to latch | |
EN | 0 | resume normal operation |
wait | > 5ms for a command to execute, or > 200us for data to set |
4-bit
Note that setting the display in 4-bit mode seems to require two commands (three write instructions: the first in 8-bit mode, the other in 2x4-bit: see page 24, 42 and 46 of the datasheet).
Pin | Action | Description |
---|---|---|
EN | 0 | make sure chip is in normal operation |
RS | 0 or 1 | command->0 or data->1 |
D4-D7 | bits 4 to 7 | place high nibble on bus |
EN | 1 | latch the data onto the chip |
wait | > 450ns for the data to latch | |
EN | 0 | make sure chip resumes normal operation (waiting for the next nibble in 4bit mode) |
wait | > 5ms for memory to prepare command, or > 200us for data to set | |
D4-D7 | bits 0 to 3 | place low nibble on bus |
EN | 1 | latch the data onto the chip |
wait | > 450ns for the data to latch | |
EN | 0 | resume normal operation |
wait | > 5ms for a command to execute, or > 200us for data to set |
physical device
Xopr 23:02, 22 June 2011 (CEST) as of today, there are two HD44780 displays in the space:
- 2x16 line/char
- 2x16 line/char for the visually impaired (bigger version)
You can find them in the 'take-off chinese box' in the right most cabinet. Use at will, but be kind to solder a connector to it, so others can take advantage of it too (be nice, share ;).
references
- joshuagalloway.com's lcd page
- HD44780 datasheet from sparkfun
- Alternative display: PVG120303
Location: Somewhere (probably in the left 'soldering cabinet')