HD44780 16×2 Char LCD Interfacing with microcontroller

Project Description:-

In this project we are going to learn various things about this chip set and displaying text on this LCD. The HD44780 16×2 char LCD screen Use 8bit and 4 bit parallel interface with backlight.

This Primary Objective in this project are:-

1.  Displaying  “Hello Word!! LCD ” message on the scree.
2.   Interfacing The LCD to the Microcontroller Using 8bit  Mode and 4 Bit Mode.
3.  Generating and Displaying Custom Char on the LCD Screen. clik here for custom char

Operation 

as i have mentioned  before this type of lcd are connected to microcontroller using parallel 8bit or 4bit lines.
using 8 bit method is quite simple but take 8 lines (for data or command)+ 3 control signal total 11 line , i guess few small microcontrollers don’t even have that much of I/O lines ,so in 4 bit mode total 7 lines (sometimes 6 ) are required .  in this tutorial i will show you with both of the methods .

HD44780 16x2 Char LCD Interfacing with microcontroller Pin description

PIN NUMBERSYMBOLFUNCTION
1VssGND
2Vdd + 3V or + 5V
3VoContrast Adjustment
4 RSH/L Register Select Signal
5R/WH/L Read/Write Signal
6E H → L Enable Signal
7 DB0H/L Data Bus Line
8 DB1H/L Data Bus Line
9 DB2H/L Data Bus Line
10 DB3H/L Data Bus Line
11 DB4H/L Data Bus Line
12 DB5H/L Data Bus Line
13 DB6H/L Data Bus Line
14 DB7H/L Data Bus Line
15A/Vee+ 3.5V for LED/Negative Voltage Output
16KK Power Supply for B/L (OV)

in 8 bit mode all the Data line DB0 to DB7 are being used for transferring the the data to lcd but in 4-bit mode only 4 line form DB4 to DB7 are being used to transfer the  8 bit wide data in two peaces one after another .

we can’t display any data on the lcd until all the required internal command register of the lcd are not being properly initialized.
to know every thing about this lcd controller .. you can go through it’s data sheet
click here to download HD44780 data sheet
so now we will learn how to initialize the lcd.

LCD Commands

Clear Display

clear  and place the cursor in the first position (address 0). The bit I / D to 1 by default.

RSR / WDB7DB6DB5DB4DB3DB2DB1DB0
0000000001

Return the cursor to Home

Place the cursor in the home position (address 0) and make the display starts to move from its original position. The contents of the RAM display data (DD RAM) remains unchanged. The address of the RAM for display data (DD RAM) is set to 0.

RSR / WDB7DB6DB5DB4DB3DB2DB1DB0
000000001X

Entry Mode in Set

Set cursor moving direction and specify that the display moves to the next position of the screen or not. These operations are performed during reading or writing of the DD RAM or CG RAM. To view usually set bit S = 0.

RSR / WDB7DB6DB5DB4DB3DB2DB1DB0
00000001I / DS

Display ON / OFF Control

Turn on or off by turning ON / OFF both the LCD (D) as the cursor (C) and whether or not this last flash (B).

RSR / WDB7DB6DB5DB4DB3DB2DB1DB0
0000001DCB

Cursor or Display Shift

Move the cursor to move the LCD without changing the memory contents of the display data DD RAM.

RSR / WDB7DB6DB5DB4DB3DB2DB1DB0
000001S / CR / LXX

HD44780 16x2 Char LCD Interfacing with microcontroller SchematicFunction Set

Set the size of interface with the data bus (DL), number of lines in the LCD (N) and character type (F).

RSR / WDB7DB6DB5DB4DB3DB2DB1DB0
00001DLNFXX

Set the CG RAM Address

The LCD module defined in addition to all the ASCII character set allows the user to define 4 or 8 characters. The composition of these characters is saved to a CG RAM memory called up to 64 bytes. Each user defined character consists of 16 or 8 bytes that are stored in successive positions of the CG RAM.

Using this instruction sets the CG RAM memory address from which the bytes will be stored that define a character. Running this command all the data that is subsequently read or write this memory made from CG RAM.

 

For more detail: HD44780 16×2 Char LCD Interfacing with microcontroller 


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.