Hitachi hd44780 schematic

Page 1
How to control a HD44780-based Character-LCD
(Industry-Standard-Character-LCD) General info and code-examples

1.1. Pin assignment

The pin assignment shown in Table 1.1. is the industry standard for character LCD-modules with a maximum of 80 characters. The pin assignment shown in Table 1.2. is the industry standard for character LCD-modules with more than 80 characters.
To be sure always check the manufacturers datasheet! To locate pin 1 on a module check the manufacturers datasheet!
Table1.1., Pin assignment for <= 80
character displays
Pin
number
Symbol Level I/O Function
1 Vss - - 2 Vcc - - 3 Vee - -
4 RS 0/1 I
5 R/W 0/1 I
6 E 7 DB0 0/1 I/O 8 DB1 0/1 I/O
9 DB2 0/1 I/O 10 DB3 0/1 I/O 11 DB4 0/1 I/O 12 DB5 0/1 I/O 13 DB6 0/1 I/O
1,
1-->0
Power supply (GND)
Power supply (+5V)
Contrast adjust
0 = Instruction input 1 = Data input
0 = Write to LCD module 1 = Read from LCD module
I Enable signal
Data bus line 0 (LSB)
Data bus line 1
Data bus line 2
Data bus line 3
Data bus line 4
Data bus line 5
Data bus line 6
Page 2
Table1.1., Pin assignment for <= 80
character displays
Pin
number
Pin
number
Symbol Level I/O Function
14 DB7 0/1 I/O
Table 1.2., Pin assignment for > 80
character displays
Symbol Level I/O Function
1 DB7 0/1 I/O
2 DB6 0/1 I/O
3 DB5 0/1 I/O
4 DB4 0/1 I/O
5 DB3 0/1 I/O
6 DB2 0/1 I/O
7 DB1 0/1 I/O
8 DB0 0/1 I/O
9 E1
10 R/W 0/1 I
11 RS 0/1 I
12 Vee - - 13 Vss - - 14 Vcc - - 15 E2
16 n.c.
1,
1->0
1,
1->0
Data bus line 7 (MSB)
Data bus line 7 (MSB)
Data bus line 6
Data bus line 5
Data bus line 4
Data bus line 3
Data bus line 2
Data bus line 1
Data bus line 0 (LSB)
Enable signal
I
row 0 & 1 0 = Write to
LCD module 1 = Read from LCD module
0 = Instruction input 1 = Data input
Contrast adjust
Power supply (GND)
Power supply (+5V)
Enable signal
I
row 2 & 3
Page 3

1.2. Instruction set

Table 1.3. HD44780 instruction set
Instruction
Clear display 0 0 0 0 0 0 0 0 0 1
Cursor home 0 0 0 0 0 0 0 0 1 *
Entry mode set
Display On/Off control
Cursor/display shift
RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
0 0 0 0 0 0 0 1 I/D S
0 0 0 0 0 0 1 D C B
0 0 0 0 0 1 S/C R/L * *
Code
Description
Clears display and returns cursor to the home position (address 0).
Returns cursor to home position (address 0). Also returns display being shifted to the original position. DDRAM contents remains unchanged.
Sets cursor move direction (I/D), specifies to shift the display (S). These operations are performed during data read/write.
Sets On/Off of all display (D), cursor On/Off (C) and blink of cursor position character (B).
Sets cursor-move or display-shift (S/C), shift
Execution
time**
1.64mS
1.64mS
40uS
40uS
40uS
Page 4
Table 1.3. HD44780 instruction set
Instruction
Function set 0 0 0 0 1 DL N F * *
Set CGRAM address
Set DDRAM address
Read busy-flag and address counter
Write to 1 0 write data Writes data 40uS
RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
0 0 0 1 CGRAM address
0 0 1 DDRAM address
0 1 BF CGRAM / DDRAM address
Code
Description
direction (R/L). DDRAM contents remains unchanged.
Sets interface data length (DL), number of display line (N) and character font(F).
Sets the CGRAM address. CGRAM data is sent and received after this setting.
Sets the DDRAM address. DDRAM data is sent and received after this setting.
Reads Busy-flag (BF) indicating internal operation is being performed and reads CGRAM or DDRAM address counter contents (depending on previous instruction).
Execution
time**
40uS
40uS
40uS
0uS
Page 5
Table 1.3. HD44780 instruction set
Instruction
CGRAM or DDRAM
Read from CGRAM or DDRAM
Remarks:
- DDRAM = Display Data RAM.
- CGRAM = Character Generator RAM.
- DDRAM address corresponds to cursor position.
- * = Don't care.
- ** = Based on Fosc = 250KHz.
Bit
name
I/D
S/C 0 = Move cursor 1 = Shift display R/L 0 = Shift left 1 = Shift right
DL 0 = 4-bit interface 1 = 8-bit interface
BF
0 = Decrement cursor position
S 0 = No display shift 1 = Display shift D 0 = Display off 1 = Display on C 0 = Cursor off 1 = Cursor on B 0 = Cursor blink off 1 = Cursor blink on
0 = 1/8 or 1/11 Duty
N
(1 line)
F 0 = 5x7 dots 1 = 5x10 dots
0 = Can accept instruction
RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
1 1 read data
Table1.4. Bit names
Settings
1 = Increment cursor position
1 = 1/16 Duty (2 lines)
1 = Internal operation in progress
Code
Description
to CGRAM or DDRAM.
Reads data from CGRAM or DDRAM.
Execution
time**
40uS
1.3. Visible DDRAM addresses

1.3.1. 1-line displays

Shown after reset (with N=0).
Table1.5. DDRAM address usage for a 1-line LCD
Display size
Character positions DDRAM addresses
1*8 00..07 00h..07h
1*16 00..15 00h..0Fh
Visible
Page 6
Table1.5. DDRAM address usage for a 1-line LCD
Display size
Character positions DDRAM addresses
1*20 00..19 00h..13h 1*24 00..23 00h..17h 1*32 00..31 00h..1Fh 1*40 00..39 00h..27h
Visible

1.3.2. 2-line displays

Shown after reset (with N=1).
Table1.6. DDRAM address usage for a 2-line LCD
Display size
Character positions DDRAM addresses
2*16 00..15 00h..0Fh + 40h..4Fh 2*20 00..19 00h..13h + 40h..53h 2*24 00..23 00h..17h + 40h..57h 2*32 00..31 00h..1Fh + 40h..5Fh 2*40 00..39 00h..27h + 40h..67h
Visible
1.3.3. 4-line displays
Shown after reset (with N=1).
Table 1.7. DDRAM address usage for a 4-line LCD
Display size
4*16 00..15 00h..0Fh + 40h..4Fh + 14h..23h + 54h..63h 4*20 00..19 00h..13h + 40h..53h + 14h..27h + 54h..67h
4*40
Character positions DDRAM addresses
(00..39) on 1st controller and (00..39) on 2nd controller
Visible
(00h..27h + 40h..67h) on 1st controller and (00h..27h + 40h..67h) on 2nd controller

1.4. Interfacing

Page 7

1.4.1. 8-bit interface

Example of busy flag testing using an 8-bit interface.
1.4.2. 4-bit interface
Example of busy flag testing using a 4-bit interface.
Example of data transfer using a 4-bit interface.
Page 8
Page 9

1.5. Characterset for 5x7 dot font

Loading...