HD44789U have 8 Bi-directional data/command ports.
RS: Register Select
If RS = 0 then Instruction Register is selected, RS = 1 Data Register is
R/W: Read or Write
If R/W = 0 then data is write to instruction register or data register of the
HD44780U n data isIf R/W = 1 then data is read from instruction register or data register of the
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.
RA0 is connected to the E (Enable), RA1 to R/W’ (Read/Write) and the RA2 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.
PIC Microcontroller is interfaced with the HD44780U with 8-bit data length.
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.