LCD & Keyboard
LCD & Keyboard
LCD & Keyboard
16X2 LCD
• capable of displaying 2 lines each having 16 Characters
• It has two types of input lines: data line and control lines
• 8 data lines, 3 control lines: Register select, Read/Write and
Enable.
• In the kit that we are using, Read/ write is grounded-> used
for write.
Data Bus: 8-bit data bus referenced as D0-D7. As it is a 8-
bit data bus, we can send the data/cmd to LCD in bytes. It
also provides the provision to send the data/cmd in chunks of
4-bit, which is used when there are limited number of GPIO
lines on the microcontroller. Accordingly two modes of
operation: 8 bit mode and 4 bit mode
• The kit that we are using is in 4 bit mode. Data lines D7-D4
are used
Register Select(RS): The LCD has two registers namely a
Data register and Command register. Any data that needs to
be displayed on the LCD has to be written to the data register
of LCD. Command can be issued to LCD by writing it to
Command register of LCD. This signal is used to differentiate
the data/cmd received by the LCD.
If the RS signal is LOW then the LCD interprets the 8-bit info
as Command and writes it to Command register and
performs the action as per the command.
If the RS signal is HIGH then the LCD interprets the 8-bit info
as data and copies it to data register. After that the LCD
decodes the data for generating the 5x7 pattern and finally
displays on the LCD.
On a character lcd a character is generated in a matrix of
5×8 or 5×7. Where 5 represents number of columns and 7/8
represent number of rows. Maximum size of the matrix is
5×8. You can not display character greater then 5×8
dimension matrix. Normally we display a character in 5×7
matrix and left the 8th row for the cursor. If we use the 8th
row of the matrix for the character display, then there will be
no room for cursor.
Read/Write(RW): This signal is used to write the data/cmd
to LCD and read the busy flag of LCD. For write operation
the RW should be LOW and for read operation the R/W
should be HIGH.