Summary of Lecture 43 : Interfacing PIC16F877 Microcontroller with an LCD
This project demonstrates interfacing a Displaytech 162A LCD with a PIC16F877 microcontroller to display the text "IITK". The process involves writing assembly code in MPLAB IDE, simulating and debugging it, and then programming the microcontroller using PIC BURNER3. The hardware setup includes a 20MHz crystal oscillator, power supply, resistors, capacitors, potentiometer, and switches, connected as per the circuit diagram. The LCD requires initialization and command execution to display characters. The project emphasizes understanding the LCD controller IC KS0070B and using proper timing for command sequences.
Parts used in the LCD Interfacing with PIC16F877 Microcontroller project:
- Displaytech 162A LCD module
- PIC16F877 Microcontroller
- MPLAB IDE software
- PIC BURNER 3 with programming software
- +5V DC Power Supply
- 10K Ω Resistor
- 50 Ω Resistor
- 27 µF Capacitors (2 units)
- 10K Ω Potentiometer
- 20 MHz Crystal oscillator
- SPST switch
- RS 232 cable
- Computer with Windows OS
To interface LCD (Displaytech 162A) with PIC16F877microcontroller and to display “IITK” in the Liquid Crystal Display (LCD).
- MPLAB IDE (PIC microcontrollers simulator)
- PIC BURNER 3 with software to load the code
- LCD (Displaytech 162A)
- Computer System with Windows operating system and RS 232 cable
- PIC16F877 Microcontroller
- +5V D.C Power Supply
- Resistors – 10K Ω-1,50Ω-1
- Capacitors – 27 µ F-2
- Potentiometers – 10K Ω -1
- 20MHz Crystal oscillator
- SPST switches -1
- Write the assembly code in MPLAB IDE simulator , compile it and check for errors
- Once the code was error free, run it and check the output in the simulator.
- After checking the code in the simulator, load the code (in .HEX format) into PIC16F877 microcontroller using PIC BURNER3.
- Make connections as shown in the circuit diagram.
- Switch on the power supply and observe “IITK” displayed in the LCD.
Liquid Crystal Display (LCD-Displaytech 162A )LCD Displaytech 162A consists of a LCD panel, a controller IC (KS0070B) and a back light LED. The LCD module consists of total 16 pins in which, 2 are for power supply, 2 pins for Backlight LED, one pin for contrast adjustment, 3 pins are for control signals and 8 pins are data pins. In order to display any data, we need to do certain initiations. The following are the main three steps in displaying any data in the LCD display.
- Initializing LCD by sequence of instructions
- Executing commands depending on our settings in the LCD
- Writing data into the DRAM locations of LCD in the Standard Character Pattern of LCD
For doing above steps, refer the manual for LCD and follow the instructions and timing diagrams strictly.
MPLABIDEMPLABIDE is a free software which can be downloaded from the website www.microchip.com
Working with MPLABIDE :
MPLABIDE is a simulator for PIC microcontrollers to write and edit the code in assembly language, compile it and also to run the code. Output can be verified using simulator.
For more detail: Lecture 43 Interfacing PIC16F877 Microcontroller with an LCD