8051_HD44780U_LCD_4 bit_5 x 8 font_1 Line
This project includes
Dot Matrix Liquid Crystal Display controller/Driver HITACHI HD44780U (LCD-II)
, 8051 Microcontroller,
1 line 8 character 5 x 8 font LCD, 74LS245 and 7404
Introduction to HD44780U
8 data pins D7:D0
HD44789U have 8 Bi-directional data/command ports.
RS: Register Select
If RS = 0 then Instruction Register is selected, RS = 1 Data Register is selected.
R/W: Read or Write
If R/W = 0 then data is write to instruction register or data register of the HD44780U
If R/W = 1 then data is read from instruction register or data register of the HD44780U
E: Enable (Latch data)
This pin is used to latch the data present on the data pins. A high-to-low edge is needed to latch the data.
Interfacing HD44780U with microcontroller
Interfacing micro controller with LCD display driver have two operations, one is modifying instruction register and other is modifying data register. Instruction register is used for setting interface data length, number of lines, shift operation e.t.c. and data register is used to store display characters.
P0.1 is connected to the E (Enable), P0.1 to R/W’ (Read/Write) and the P0.2 to RS (Register Select).
To modify registers first check the busy flag, int Busy (void) function perform this operation. If busy flag is zero then set RS = 0 for instruction Register and RS = 1 for data Register. If R/W = 0 for writing the data to instruction register or data register of the HD44780U, A high-to-low edge in Pin E is needed to latch the data.
void Command (int Value) function to write data to instruction register and void Display (int Value) function is to write data to data register.
8051 Microcontroller is interfaced with the HD44780U with 4-bit data length. For 4 bit data interface 8 bit data is split into two 4 bit data, that operation is perform by void Command2 (int Value) to modify instruction register and void Display2 (int Value) to modify data register.
To simulate circuit in this project, initially activate Mixed Mode simulator from the Schematic Editor window. Selecting Run Transient analysis from Simulation menu can perform simulation.
The source code in the
code editor window
has to be
compiled
after making any modifications
(editing).
Also the code can be
debugged
during
simulation.