module 3_lcd interface

12
LCD Interfacing

Upload: vishal-gudla-nagraj

Post on 18-Dec-2015

239 views

Category:

Documents


3 download

DESCRIPTION

Module 3_LCD Interface

TRANSCRIPT

Slide 1

LCD InterfacingLCD Modules16 x 2 LCD Display16x4 LCD Display20x 4 LCD Display

How we can Interface?Pins of LCD

Pin Description of LCD LCD PowerVSS - GND,VCC=+5V DC, VEE- Contract/Brightness Adjust connect 10 K Pot 3 Control Lines RS- Register Select 0=Command Mode1=Data ModeR/W=Read/Write0=Write 1=ReadEn=Enable 1=Enable the LCD0=Disable the LCD8 Data LinesD0-D7- Data lines of LCD BacklightLED+ & LED- = It is used to provide the Background light to the LCD

8051 Interface with LCD- 8 bit Mode

8051 Interface with LCD- 4 bit Mode

Embedded C Programming

It need to declare the data type for the LCD pins RS,RW,EN & D0-D7 By using different data type likeSfr address P0=0x80,P1=0x90;P2=0xA0;P3=0xB0;Sfr LDATA= 0xA0;

Sbit RS=P1^0;Sbit RW=P1^1;Sbit EN=P1^2;Means it need to interface 11 of the LCD Display to the 8051 MicrocontrollerIf we Used 8 data lines of LCD It is called 8 bit Mode of the LCDIf we Used 4 data lines of LCD It is called 4 bit Mode of the LCD

Pseudo Code Add reg51.h header fileDeclare LCDCMD,LCDDATA & DELAY Function

Declare the data types for all the pins using sfr & sbit

Inside the main Pass first the commands for the LCD Like 0x38,0x0E,0x06,0x01,0x80,0xC0After that pass the data stream

Define the function definition LCDCMD,LCDDATA & DELAYRS=0 then data Mode RS=1 then Command mode

?THANK YOU