Smarthome Remote Control System Producer

KinCony Electronic —- makes our life more beautiful quality more excellent and life more intelligent

8.8. Experiment with 1602 Character LCD Module

Posted by admin July - 27 - 2010 - Tuesday

Character LCD module is a type of LCD display, designed to display characters, numerical numbers, sign, etc. 16*1, 16*2, 20*2, 40*2 are most frequently used modules.

Specifications and Pin Assignment

There are two types of 1602 LCD, with backlight one, and without backlight one. Its controller IC is HD44780. The LCD with backlight is thicker than that without backlight. Their dimensional difference are shown in below picture.

Display Content: 16 * 2 characters

Operation Voltage: 4.5 – 5.5V

Working Current: 2.0mA at 5.0V

Recommended Working Voltage: 5.0V

Character Dimension: 2.95 * 4.35 (W * H)mm

Pin No. Symbol Function
1 Vss Ground
2 Vdd +5V
3 VL LCD contrast adjust.When VL is connected to Vdd, LCD contrast is the lowest. When VL is connected to Vss, LCD contrast is the highest. For best visibility, use a 10k potentiometer to get the suitable resistance.
4 RS Register select.High level to select data register. Low level to select command register.
5 R/W Read / WriteHigh level to read and low level to write. When both RS and R/W are low, command or data address can be written. When RS is low, and R/W is high, busy signal can be read. When RS is high and R/W is low, data is allowed to be written into registers.
6 E EnableHigh to low level, LCD execute commands.
7 DB0 Data bit 0. Bidirectional data bus.
8 DB1 Data bit 1 Bidirectional data bus.
9 DB2 Data bit 2 Bidirectional data bus.
10 DB3 Data bit 3 Bidirectional data bus.
11 DB4 Data bit 4 Bidirectional data bus.
12 DB5 Data bit 5 Bidirectional data bus.
13 DB6 Data bit 6 Bidirectional data bus.
14 DB7 Data bit 7 Bidirectional data bus.
+ BL+ Power Supply for BL+
- BL- Power Supply for BL-

Instruction and Timing

Instruction RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
Clear Display 0 0 0 0 0 0 0 0 0 1
Cursor At Home 0 0 0 0 0 0 0 0 1 -
Entry Mode Set 0 0 0 0 0 0 0 1 I/D SH
Display On/Off Control 0 0 0 0 0 0 1 D C B
Cursor or Display Shift 0 0 0 0 0 1 S/C R/L - -
Function Set 0 0 0 0 1 DL N F - -
Set CGRAM Address 0 0 0 1 AC5 AC4 AC3 AC2 AC1 AC0
Set DDRAM Address 0 0 1 AC6 AC5 AC4 AC3 AC2 AC1 AC0
Read Busy Flag and Address 0 1 BF AC6 AC5 AC4 AC3 AC2 AC1 AC0
Write Data to RAM 1 0 D7 D6 D5 D4 D3 D2 D1 D0
Read Data from RAM 1 1 D7 D6 D5 D4 D3 D2 D1 D0
Instruction Function
Clear Display Write 20H to DDRAM and set DDRAM address to 00H from AC
Cursor At Home Set DDRAM address to 00H from AC and return cursor to its original Position if shifted. The contents of DDRAM are not changed.
Entry Mode Set Assign cursor moving direction and enable the shift of entire display.
Display On/Off Control Set display (D), cursor(C), and Blinking of cursor (B) ON/OFF control bit.
Cursor or Display Shift Set cursor moving and display shifts cursor bit, and the direction, without changing of DDRAM data.
Function Set Sets interface data length (DL: 8-BIT / 4-BIT), number of display lines(N: 2-line / 1-line) and, display font type (F: 5x11dots / 5×8 dots).
Set CGRAM Address Set CGRAM address in address counter.
Set DDRAM Address Set DDRAM address in address counter.
Read Busy Flag and Address Whether during internal operation or not can be known by reading BF. The contents of address counter can also be read.
Write Data to RAM Write data into internal RAM (DDRAM / CGRAM)
Read Data from RAM Reads data from internal RAM (DDRAM / CGRAM).

Software and Hardware Design

Display the website link www.hificat.com in first line of 1602 LCD.

Display the telephone number 0571-85956028 in second line of 1602 LCD.

Switch to LCD display mode before this experiment.

Schematic Diagram

1602 LCD can communicate with MCU AT89C51 directly.

Program Flow Chart

Leave a Reply

Universal Programmer | Gang Programmer | Device Programmer | ISP Programmer | Eeprom Programmer | IC Programmer
Copyright © 2003-2012 Programmerkit.com All Rights Reserved.
Add:Rm 852,4F,Zhejiang Shidai Electronics Market,Dengyun Rd 428, Hangzhou, Zhejiang, China. P.C.:310011