Summary of Interface a HD44780 Character LCD with a PIC Microcontroller
The article explains how to interface an HD44780 character LCD with a PIC16F628A microcontroller using mikroC. It outlines the configurations of HD44780 LCDs, highlights their common use in various devices, and specifies the connection setup for 4-bit mode communication. The LCD’s data pins D4-D7 connect to PORTB pins RB4-RB7, while control pins RS and EN connect to PORTA pins RA0 and RA1. It also advises disabling comparator functions on PORTA pins when using them as digital I/O.
Parts used in the Test LCD in 4-bit mode Project:
- HD44780 Character LCD
- PIC16F628A microcontroller
- Connection wires for interfacing
- Power supply (not explicitly mentioned but implied)
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 8×1, which is one row of eight characters, 16×2, and 20×4. The most commonly manufactured configuration is 40×4 characters, which requires two individually addressable HD44780 controllers with expansion chips as the HD44780 can only address up to 80 characters.
These LCD screens are limited to text only and are often used in copiers, fax machines, laser printers, industrial test equipment, networking equipment such as routers and storage devices. Character LCDs can come with or without backlights, which may be LED, fluorescent, or electroluminescent. Character LCDs use a standard 14-pin interface and those with backlights have 16 pins.
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