0% found this document useful (0 votes)
50 views

Exp No 3

This document describes an experiment to interface a 16x2 LCD display with an 8051 microcontroller. It includes the objectives, required tools, theory, algorithms, functions used, and interfacing diagram. The objectives are to interface the LCD and enable character display. Required tools are a Keil compiler, 8051 development board, and 16x2 LCD. The theory section discusses LCD interfacing in 4-bit and 8-bit modes. Algorithms show the steps, and functions in the LCD library are described. The result is that various characters were successfully displayed on the LCD.

Uploaded by

dharanika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Exp No 3

This document describes an experiment to interface a 16x2 LCD display with an 8051 microcontroller. It includes the objectives, required tools, theory, algorithms, functions used, and interfacing diagram. The objectives are to interface the LCD and enable character display. Required tools are a Keil compiler, 8051 development board, and 16x2 LCD. The theory section discusses LCD interfacing in 4-bit and 8-bit modes. Algorithms show the steps, and functions in the LCD library are described. The result is that various characters were successfully displayed on the LCD.

Uploaded by

dharanika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

SRI KRISHNA COLLEGE OF TECHNOLOGY

(AN AUTONOMOUS INSTITUTION)

KOVAIPUDUR, COIMBATORE- 641042

Reg. No and Name of the student


Experiment No
Date of Experiment
Title of Experiment

Evaluation by Faculty Member

Maximum Marks Scored


Criteria
Marks by the student
Objectives & Tools required 10
Source Code 30
Compilation and Debugging 30
Result and Discussion 20
Documentation 10
Total Marks

OBJECTIVES
To interface 16x2 LCD display with 8051 microcontroller and to enable it for displaying
different characters.

SYSTEM AND SOFTWARE TOOLS REQUIRED


Keil uVision4 compiler, 8051 Microcontroller Development board, 16x2 LCD

THEORY
Keil C does not have powerful libraries for 16x2 LCD interfacing. Hence LCD library must be
developed with common features. Header file lcd.h must include the sub-program for LCD functions.
LCD can be interfaced with microcontroller in 4 Bit or 8 Bit mode. This differs in how data is send to
LCD. In 8 bit mode to write a character, 8 bit ASCII data is send through the data lines D0 – D7 and data
strobe is given through E of the LCD. But 4 Bit Mode uses only 4 data lines D4 – D7. In this mode 8 bit
character ASCII data and command data are divided into two parts and send sequentially through data
lines. 4 bit communication is used save pins of microcontroller but it is slower than 8 bit communication.
ALGORITHMS

Step1: Include a header file to assign special function registers for ports of the microcontroller
Step2: Include a header file for LCD i.e. lcd.h
Step3: Assign LCD module connections to ports of the controller. Example: sbit RS = P0^0;
Step4: Use sub-routines for invoking delay
Step5: Use special functions of LCD in main program
Step6: For 4 bit LCD interface, use LCD4 instead of LCD8 functions

FUNCTIONS USED FOR INTERFACING LCD:

Sub-routines for accessing LCD can be designed in header files

Functions Description
Lcd8_Clear() Clear the LCD screen
Lcd8_Set_Cursor() To set the cursor position on the LCD screen
Lcd8_Write_Char() To write a character
Lcd8_Write_String() To write a string
Lcd8_Shift_Left() Shift display left without changing the data in display RAM
Lcd8_Shift_Right() Shift display right without changing the data in display

INTERFACING DIAGRAM:
PROGRAM:
RESULT
Thus the 16x2 LCD display is interfaced with 8051 microcontroller and different
characters was displayed and verified

You might also like