Sie sind auf Seite 1von 24

INTERFACING GRAPHICAL LCD WITH 8051

Click to edit Master subtitle style

Submitted By: Rohan Dhakad Submitted to: Ambuj Pandit

CONTENTS
1. 2. 3. 4. 5. 6. 7. 8. 9.

INTRODUCTION TO GRAPHICAL LCD BASIC FEATURES PIN DESCRIPTION GRAPHICAL LCD PINS LCD DESCRIPTION COMMANDS FOR SELECTION HOW TO GLOW A PARTICULAR PIXEL? INTERFACING LCD WITH 8051 CODING

INTRODUCTION TO GRAPHICAL LCD


Liquid crystal graphic display modules Click to edit Master subtitle are used in a wide variety of style applications due to its thin profile, light weight, low power consumption and easy handling used for displaying information such as text, images, and moving pictures. A 128*64 LCD has a 1024 byte memory , every bit of which is visible. The display is split logically in half.. Each half is controlled by a controller.

BASIC FEATURES
Click to edit Master subtitle style
DISPLAY FORMAT :128*64 DOTS LCD MODE :STN-Yellow green-Positive-Transmissive DRIVING METHOD :1/64 Duty,1/9 Bias VIEWING ANGLE :6:00 BACKLIGHT :LED, yellow green color OUTLINE DIMENSION : 93.0(W)*70.0(H)*13.5(T) mm VIEWING ANGLE :72.0(W)*39.0(H) mm DOT SIZE :0.48*0.48 mm DOT PITCH :0.52*0.52 mm WEIGHT :75 g CONTROLLER :S6BO108(KS0108B)

PIN DESCRIPTION

GRAPHICAL LCD PINS


Terminal Functions

RS :-REGISTER SELECT
H-Display Data L-Instruction Code

R/W:-READ/WRITE
H-Read Operation L-Write Operation

E-ENABLE SIGNAL

Read data when E is high, write data at falling edge of E.

DB0-DB7- BIDIRECTIONAL DATA/COMMAND PINS

VSS-Ground VDD-+5V Power supply


V0-Operating Voltage for Lcd(contrast adjustment) CS1-Chip Selection for IC1,acitive high CS2-Chip Selection for IC2,acitive high RST-Reset Signal ,active low VOUT- -10V,Output Voltage for driving LCD LEDA-+5V,Power Supply for LCD Backlight LEDK-0V,Power Supply for LCD Backlight

LCD DESCRIPTION

The graphic LCD is divided into two half: LEFT HALF RIGHT HALF The graphical LCD consists of 64 rows and 128 columns, Row is divided into 8 pages (0-7) each of 8 bits. The 128 bits of the column are divided into 2 halves each of 64 bits. These are selected from the LCD pin no. 15 and 16 i.e. CS1 and CS2.

LCD Commands

The LCDs internal controller can accept several commands and modify the display accordingly. These commands would be things like:
Clear screen Return home Decrement/Increment cursor

After writing to the LCD, it takes some time for it to complete its internal operations. During this time, it will not accept any new commands or data.
We need to insert time delay between any two

commands or data sent to LCD

COMMANDS FOR SELECTION


1.DISPLAY ON/OFF: When D=1;data appears. When D=0;data disappears.

RS 0

R/W DB7 DB6 0 0 0

DB5 DB4 DB3 DB2 1 1 1 1

DB1 DB0 1 D

2. READ\WRITE DISPLAY DATA: When A=0;write data When A=1;read data

RS 0

R/W DB7 DB6 A DB7 DB6

DB5 DB4 DB3 DB2 DB5 DB4 DB3 DB2

DB1 DB0 DB1 DB0

3.Set address (Y address):

RS 0

R/W DB7 DB6 0 0 1

DB5 DB4 DB3 DB2 AC5 AC4 AC3 AC2

DB1 DB0 AC1 AC0

This is used to select a particular column on the selected half lcd display screen. The starting address: 01000000(AC5-AC0=00000) = 40H The last address: 01111111(AC5-AC0=11111)=7FH i.e in total 40H-7FH= 64 An address is set by instruction and incremented by 1 automatically by
read or write operation of display data

4.SET PAGE (X ADDRESS):

RS 0

R/W DB7 DB6 0 1 0

DB5 DB4 DB3 DB2 1 1 1 AC2

This is used to select one of the 8 pages. Address of first page:10111000 i.e B8H
Address of last page:10111111 i.e BFH 5.DISPLAY START LINE (Z ADDRESS):

DB1 DB0 AC1 AC0

RS 0

R/W DB7 DB6 0 1 1

DB5 DB4 DB3 DB2 AC5 AC4 AC3 AC2

This is used to select a particular bit in a page. Address of the first bit:11000000 i.e C0H
Address of the last bit:11111111 i.e FFH In total there are 64 bits.

DB1 DB0 AC1 AC0

6. STATUS READ

BUSY=1 ; chip is executing internal operation. 0 ; chip is ready to accept any instruction. ON/OFF=1; display is off. 0; display is on. RESET=1; system is being initialized. 0; system is initialized.

HOW TO GLOW A PARTICULAR PIXEL?


Suppose we want to glow all the pixels on page BDH and column 40H

First we have to display on the LCD. Set the LCD in the command mode Set Y address which chooses one of the 64 vertical rows in the half of the screen that is currently selected by CS1 or CS2. Set the X page which selects which of the 8 horizontal stripes the 8 data bits will be placed in. Write 8 bit data on the pins selected as data pins.

Suppose Y address is set to 34, X page is set to 0 and DATA PINS=0b10101010 then the picture represented in the figure below will appear on the LCD

012345678910111213 616263

ZOOMED IMAGE

Introduction to Microcontrollers
Microcontrollers

CPU + I/O + Timer(s) [+ ROM] [+ RAM] Low to moderate performance only Limited RAM space, ROM space and I/O pins EPROM version available Low chip-count to implement a small system Low-cost at large quantities

Development tools readily available at reasonable cost.

INTERFACING LCD WITH 8051


8051

P0. 1 P0. 2 P0. P3. 3 P3. P2.0P2.7 4

LG12864KS0 108b R R/ S W E CS1 CS2 D7-D0

cODING
Click to edit Master subtitle style
void main(void) { unsigned char x; GDispInit (); for(;;){ GDispPixStrAt (50,32, "CITM", 1, BLACK); //Display ASCII string CITM at (x , y) =(0,20) with font space =1 and color = Black// GDispPixStrAt (50,42, "INDORE", 1, BLACK); for(x=0;x<128;x++) GDispSetPixel (x,0,BLACK); for(x=0;x<128;x++)

GDispPixStrAt(0,10, " !#$%&'()*+,-./0123456789:;<=>? @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'abcdefghijklmn opqrs tuvwxyz{|}~", 2, WHITE); DelayMs(3000); GDispClr(0x00);

ZOOMED IMAGE

THANK YOU

Das könnte Ihnen auch gefallen