CAM PROJECT REPORT1
CAM PROJECT REPORT1
Cherthala
PROJECT
ON
LCD INTERFACING
Laghima PM
Made by,
Akash A A - 6
Bhagavath S - 8
PROJECT TITLE
ABSTRACT
INTRODUCTION
COMPONENTS REQUIRED
PROCESS OF WORKING
APPLICATION
CONCLUSION
ABSTRACT
INTRODUCTION
COMPONENTS REQUIRED
Keil Microvision 5
LCD
Connecting Wires
Nuvoton Microcontroller
KEIL MICROVISION 5
LCD
CONNECTING WIRES
NUVOTON MICROCONTROLLER
PROCESS OF WORKING
Display units are the most important output devices in
embedded projects and electronics products. 16x2 LCD
is one of the most used display unit. 16x2 LCD means
that there are two rows in which 16 characters can be
displayed per line, and each character takes 5X7
matrixspace on LCD. In this tutorial we are going to
connect 16X2 LCD module to the 8051microcontroller
PIN DISCRIPTION
RS: RS is the register select pin. We need to set it to 1,
if we are sending some data to be displayed on LCD.
And we will set it to 0 if we are sending some command
instruction like clear the screen.
RW: This is Read/write pin , we will set it to 0, if we are
going to write some data on LCD. And set it to 1, if we
are reading from LCD module. Generally this is set to 0,
because we do not have need to read data from LCD.
Only one instruction “Get LCD status”, need to be read
some times.
E: This pin is used to enable the module when a high to
low pulse is given to it. A pulse of 450 ns should be
given. That transition from HIGH to LOW makes the
module ENABLE.
#include <reg51.h>;
#define LCD_DATA P2
sbit RS = P3^0; // Register select pin
sbit EN = P3^1; // Enable pin
sbit SW_PIN = P1^0; // Switch pin
void main()
{
LCD_Init(); // Initialize LCD
while (1)
{
if (SW_PIN == 0)
{
LCD_Command(0x01); // Clear display
LCD_Command(0x80);// Move cursor to line1
LCD_WriteString(“NO”);
}
else if (SW_PIN == 1)
{
LCD_Command(0x01); // Clear display
LCD_Command(0x80); // Move cursor to line 1
LCD_WriteString(“YES”);
}
delay(100); // Delay between updates
}
}
CODE EXPLANATION