Keywords: PIC, LCD, connection, display, simulation
APPLICATION NOTE
Connecting LCD to PIC, specifically, LCD type LM016, PIC16F877A and Displaying One
Line Message.
By Ch’ng Chear Cheah
Abstract: This document describes on the use of light crystal display, LCD. As the design project is on a heartbeat analyser, it analyses consistency of heartbeat as well as missing beat of the heart and hence the device needs a channel to display the information for the user. Detection of normality of the heartbeat and heartbeat rate is displayed via LCD.
Introduction
LCD comes in different shapes and sizes that can support different numbers of text and different numbers of characters per row. The one that was used was the 16 characters by 2 lines type or the LM016L. A
PIN NUMBER SYMBOL DESCRIPTION
1 V
2 V
3 V
4 RS Register select
RS=0 selects command input
RS=1 selects data input
5 R/W Read/write status
Write to LCD=0
Read from LCD=1
6 E Enable signal
7-14 DB0-DB7 Data bus lines
Objective
The objective of this document is to describe the connection of PIC and LCD and run a simple program to display a message on the LCD.
information to the user. The LM016L is controlled via 14 pins. The names and description of these pins are as follows:ss Ground referencedd Power supply (5V)ee Contrast adjustment voltage
Issue
Simulation is done using PROTEUS and codes compilation is done by MPLAB IDE.
Steps
1. From PROTEUS, select PIC6F877A and LM016L.
2. All pins are connected accordingly to the circuit diagram.
3. The source code as attached in appendix is written in notepad and is saved in
the format of testrun.asm. Comments are included to aid in better understanding
of coding.
4. From MATLAB IDE, open the file of testrun.asm and in the toolbar of MATLAB
IDE, select project then build the source code from Quickbuild (no .asm file).
5. After compiling the source code, load the file generated to the PIC in PROTEUS.
Double click on the PIC in PROTEUS and the window of edit component will
appear. From the program file panel, browse for testrun.HEX file. The program
file of testrun.HEX could be found in the folder as testrun.asm is initially saved.
6. Run the simulation.
Conclusion
This application note has explained a simple program of displaying a one line message on LCD by programming the PIC. However, the language used in this application note is assembly language. Other language such as C language could also be used.
Recommendation
There are a lot more to explore in displaying of LCD. More information could be obtained from the internet and books available on shelf which provide detailed guidance.
Martin Bates, 2006,
Simulation
Alanesh R C Maharaj, Andrew Vareed,
Panel.
http://www.campbellsci.com/app-notes
ReferencesInterfacing PIC Microcontrollers Embedded Design By Interactive, Elsevier, UK.PIC Microcontroller-Based Information DisplayUnpublished B.Sc. thesis, University of South Pacific.