lcdinterfacing

KS0108B Graphics LCD

TELL A FRIEND

In this webpage, we describe how a display using the popular KS0108B controller can be driven by an 8051 or compatible microcontroller. Here we have used 128x64 pixels graphic display module with KS0108B display driver. It has the internal display RAM for storing the display data transferred from a 8 bit micro controller and generates the dot matrix Liquid crystal driving signals corresponding to stored data.

Pin Diagram

Symbol  Level  Function 
Vss  0V  Ground 
Vdd  +5V  Power supply for logic 
Vo  Operating voltage for LCD (contrast adjusting) 
RS  H/L  Register selection H:Display data L:Instruction code 
R/W  H/L  Read/Write selection H:Read operation L:Write Operation 
H,H->L  Enable Signal.Read data when E is high,Write data at the falling Edge of E 
DB0  H/L  Data bit 0  
DB1  H/L  Data bit 1 
DB2  H/L  Data bit 2 
DB3  H/L  Data bit 3 
DB4  H/L  Data bit 4 
DB5  H/L  Data bit 5 
DB6  H/L  Data bit 6 
DB7  H/L  Data bit 7 
CS1  select the right half of display the CS1 bit is set 
CS2  select the left half of display the CS2 bit is set 
/RST  Reset signal, active low 
Vout  -10V  Output voltage for LCD driving  
LEDA  +5V  Power supply for LED back light 
LEDB  0V  GND for LED back light 


Memory map

The 128x64 graphic lcd is divided into two 64X64 pixel display area.Each driver KS0108B controls a 64 column by 64 row pixel array. The 64 pixel row arrays are further grouped into 8 pages.Each page is 8 bits or 1 Byte tall. When you write a 8-bit data this "8 bit tall" area is filled up according to coloumn address. The LSB bit of the data byte is at the top and the MSB bit is at the bottom.


LCD Addressing

The first top most Page address is 0x0b8 and the lowermost page is 0x0c0. Likewise the left most column has an address of 0x040 and the rightmost column is at 0x080

Whenever you write data into the display RAM, the column address alone is incremented automatically by one. And when the increment happens after the last column (0x080) it rolls over and overwrites on the first column in the current page.

To change the page use X address set instruction


Circuit diagram

At89C51 (8051) microcontroller is used to drive KS0108B 128x64 graphic LCD.Port 0 is connected to the data bus of graphic lcd.Port 1 is used as control bus.Reset pin of graphic LCD is connected to Vcc.CS1 and CS2 pins are used to control display half select.

Power supply

LCD Initialization

1.Send the display off command 3eh

2. Send the display on command 3fh

3.If required you can use 11xx xxxx instruction to set the display line start

4. Set the Y-adddress to first coloumn 40h

5.Set the X-address to first page 0B8h

6.Blank the Display( clear all 128x64 pixels)

Output on KS0108B Graphics LCD

You can see the output is generated on the graphic LCD having driver KS0108 using 8051 microcontroller

Source Code: KS1080b_lcd.asm

Acceptance of ignorance is true path of knowledge -Pujya Dadashri

© 2010 LCD Interfacing.