Summary of Interface a HD44780 Character LCD with a PIC Microcontroller
An HD44780 character LCD is a text-only display used in many embedded devices. Common sizes include 8x1, 16x2, 20x4 and 40x4 (which uses two controllers). Character LCDs use a 14-pin interface (16 pins with backlight) and may include various backlight types. The article shows interfacing an HD44780 LCD to a PIC16F628A microcontroller in 4-bit mode using mikroC, connecting LCD data lines D4–D7 to RB4–RB7 and RS/EN to RA0/RA1, and reminds to disable PORTA comparator functions when using RA0–RA3 as digital I/O.Parts used in the Test LCD in 4-bit mode:
- HD44780 character LCD (example sizes: 8x1, 16x2, 20x4, 40x4)
- PIC16F628A microcontroller
- Connection wires
- Power supply for MCU and LCD
- Backlight (optional: LED, fluorescent, or electroluminescent)
- mikroC compiler (software)
- Resistors/potentiometer for contrast (typical for LCD)
Introduction
An HD44780 Character LCD is a liquid crystal display (LCD) display device designed for interfacing with embedded systems. These screens come in a variety of configurations including 8x1, which is one row of eight characters, 16x2, and 20x4. The most commonly manufactured configuration is 40x4 characters, which requires two individually addressable HD44780 controllers with expansion chips as the HD44780 can only address up to 80 characters.

I am going to show you how to interface such a LCD to a PIC microcontroller (PIC16F628A). The programming for PIC will be done in mikroC (a C compiler for PIC from mikroelektronika).
Note: Never forget to disable the comparator functions on PORTA.0, 1, 2, 3 pins if you are going to use those pins as digital I/O.
Test LCD in 4-bit mode
* Description:
This code demonstrates how to display test message on a LCD which
is connected to PIC16F628A through PORTB. D4-D7 pins of LCD are
connected to RB4-RB7, whereas RS and EN pins connected to RA0 and RA1
Quick Solutions to Questions related to Test LCD in 4-bit mode:
- How are the LCD data pins connected to the PIC16F628A in this project?
LCD data pins D4-D7 are connected to PIC PORTB pins RB4-RB7. - Where are RS and EN pins of the LCD connected?
RS and EN are connected to PIC PORTA pins RA0 and RA1 respectively. - Which MCU pins require disabling comparator functions when used as digital I/O?
Disable the comparator functions on PORTA pins RA0, RA1, RA2, and RA3 when using them as digital I/O. - What microcontroller is used in the example interfacing?
The example uses the PIC16F628A microcontroller. - What compiler is used for programming the PIC in this project?
Programming is done using the mikroC compiler from mikroelektronika. - What interface mode is demonstrated for the LCD?
The code demonstrates interfacing the LCD in 4-bit mode. - How many pins does a character LCD use and how many if it has a backlight?
Character LCDs use a standard 14-pin interface and use 16 pins if they include a backlight. - Can HD44780 character LCDs display graphics?
No, these LCDs are limited to text only.
Related projects
Leveraging Blockout Banners for Effective Electronics and Tech Product Displays
Blockout banners have become a popular and effective tool for displaying electronics and tech products in various settings, from trade shows and...
LCD & Display Projects · PIC18F4520Interfacing PIC18F4520 microcontroller with an HD44780 LCD
Introduction Being able to display data from a microcontroller visually has many advantages. It allows for menus, status indicators, and instructions to...
LCD & Display ProjectsVideo Project Development in the Midst of an Impromptu Online Semester
Receiving robot parts in the mail was an unexpected conclusion to the Winter 2020 semester for students. However, when faced with a...
LCD & Display Projects · PIC16F628AFrequency Counter by PIC16F628
In this project we are building a basic and low cost frequency counter circuit . It can measure from 16Hz to 100Hz...
LCD & Display ProjectsWHAT IS A PIC MICROCONTROLLER? WHAT CAN IT DO?
PIC microcontrollers ( Programmable Interface Controllers), are electronic circuits that can be programmed to carry out a vast range of tasks. They...
LCD & Display Projects · PIC16F877ASerial Data Received from PC and Displayed on 16×2 Using USART of Pic16f877 Microcontroller
Here is a simple tutorial on how to receive serial data from PC(Personal Computer) Hyperterminal and display it on 16x2 lcd using...
