How to Interface LCD Display to a Microcontroller

LCD crystal displays allow a better user interface compared with LED displays as it is much easier to display text messages in LCD displays. They also consume much less power than LED displays. Nonetheless, LED displays have better intensity than LCD displays

LCD displays are available usually in 8 x 2, 16 x 2, 20 x 2 or 20 x 4 formats. 8 x 2 means 2 lines of 8 characters each. These displays come with an LCD controller that drives the display.

The figure below shows the interface of an LCD display with a microcontroller, please note, this article is just showing the basic principles, the full details can be found on the official documentation for that specific microcontroller you working with.

There are three control lines, namely EN (enable), RS (register select) and RW (read/write). The EN line is used to instruct the LCD that the microcontroller is sending the data. When the RS line is HIGH, the data comprise text data to be displayed on the LCD. When the RS is LOW, the data is treated as a command or instruction to the LCD module. When the RW line is LOW, the instruction on the data bus is written on the LCD. When the RW line is HIGH the data is being read from the LCD.

The software routine initializes the LCD at the start by setting the width of the data bus, selecting the character, font, and so on, clearing the LCD, turning the LCD module and the cursor, setting the cursor position, and so forth. Then the data to be displayed is sent on the data lines and the three control signals are made use of to ensure proper LCD operation.

Please follow us and share:

Author: John Mulindi

John Mulindi has a background in a technical field and he writes on topics ranging from automation, computer systems, embedded systems, mechatronics to measurement and control.

Leave a Reply