Connecting an LCD Display

Useful as it is to display results on a pc via the RS232 link, it is not always possible to have a PC connected all of the time.

By connecting a 1 or 2 line LCD display to your PIC Project, results of measurements or user instructions can be displayed on a device that may be portable and battery powered.

Many of the 1 or 2 line LCD displays available are based on the HD44780 chip, these are catered for in the Proton IDE + Basic (and many other systems) that I use. Interfacing them is just a question of connecting up the relevant ports, adding a couple of declare statements and the compiler does the rest. With an LCD hooked up, you can use the 'Print' command to print to the LCD.

The help function of the IDE shows an example circuit, along with the necessary statements to make it work. There are a few special control characters for clearing the display, setting and moving the cursor - these are also detailed in the IDE help.

For more information on controlling these displays, google for HD44780 for examples and data sheets available on the web.

The example below is the circuit I have used, it differs from the Proton IDE example because I keep the PIC 16F876 port B3/PGM pin set as PGM so that LVP (Low Voltage Programming) can still be used.

It also shows a variable resistor connected to Port A0/AN0 as and example of a simple volt meter (0 - 5v). The code prints a message to the serial port, sets up the ADC, clears the display and then displays a measurement of the voltage on the AN0 input.

For practical use, you would need to provide a better voltage reference and protect the AN0 pin from inputs higher than 5v.

Example of LCD / PIC interface
lcd.bas
Experimenting with Microchip PIC 16F876, 16F628 and other Processors

Introduction
About the PIC Processor
Programing the PIC
Building Blocks
PIC Test Rig

Connecting an LCD
VoipDeskPhone
VoipDeskPhone the Software
VoipDeskPhone3 Changes for use as an Asterisk Console Phone

Cheap PIC Keypad PoundShop Clock / Alarm = Cheap Keypad

3 State LEDs

Add DRAM to a PIC
PIC Links


Google
 
Web picprojects.247n.com

Electronics and Internet Sites at www.247n.com