ks0108 lcd controller

disclaimer / info:

DISCLAIMER:
THIS IS EXPERIMENTAL SOFTWARE AND HARDWARE. USE AT YOUR OWN RISK. THE MAINTAINER(S) OF THESE PAGES AND THE DEVELOPER(S) OF SOFTWARE AND HARDWARE PRESENTED ON THESE PAGES CAN NOT BE HELD LIABLE UNDER ANY CIRCUMSTANCES FOR DAMAGE TO HARDWARE OR SOFTWARE, LOST DATA, OR OTHER DIRECT OR INDIRECT DAMAGE RESULTING FROM THE USE OF THIS SOFTWARE OR HARDWARE. IF YOU DO NOT AGREE TO THESE CONDITIONS, YOU ARE NOT PERMITTED TO USE OR FURTHER DISTRIBUTE THIS SOFTWARE OR TO USE ANY TEMPLATES FOR BUILDING HARDWARE PRESENTED HERE.

ks0108 lcd controller:

description

Samsung KS0108 is a generic display controller found in certain display modules.

The following controllers are known to be compliant to KS0108:

  • Samsung S6B0108 (verified)
  • Samsung S6B0708
  • Samsung S6B2108
  • Samsung KS0708
  • Hitachi HD61202
  • Neotec NT7108
  • AX6108
specifications
resolution 64x64 per controller, up to 4 controllers supported (=> 256x64)
colours monochrome
controller KS0108 or compliant
adjustable contrast no
name in serdisplib "KS0108"       (example: serdisp_init(sdcd, "KS0108", ""); )

some images

[ks0108 testserdisp] [ks0108 graphlcd]
test image generated by testserdisp output generated by graphlcd
[ks0108 256x64 running on freebsd] [ks0108 256x64 graphlcd]
256x64 display module running on PC-BSD / FreeBSD test output generated by multidisplay on a 256x64 display module
top ^

connecting a ks0108-based display to the parallel port:

intro

serdisplib supports the standard wiring that is used by most projects around the ned, but user specific wiring is also possible through customisable wiring

pre-defined wiring

  • valid for all pre-defined wirings: D0 to D7 are wired to pin 2 to 9
  • "WIRING=Standard"
           A0  .. pin 17 (nSELIN)
           CS1 .. pin 14 (nAUTO)
           CS2 .. pin 16 (INIT)
           EN  .. pin  1 (nSTRB)
          

CS multiplexing

if a display with more than two controllers is used the two cable select lines (CS1 and CS2) are automatically switched into multiplexing mode:
CS signalsselected controller
(active low)
12
LL0
HL1
LH2
HH3
any de-multiplexing chip with the following features can be used:
  • at least 2 address input lines (two lines are used)
  • at least 3 (192x64) or 4 (256x64) output lines
  • output lines are active low

examples:

  • 74HC138 or similar:
            __  __  __  __  __  __  __
        Vdd Y0  Y1  Y2  Y3  Y4  Y5  Y6       A0 .. CS1
                                             A1 .. CS2
        |   |   |   |   |   |   |   |        A2 .. -> GND
        16  15  14  13  12  11  10  09
       --------------------------------      /Y0 .. /CS on controller 0
      |                                |     /Y1 .. /CS on controller 1
       >         74HC138               |     /Y2 .. /CS on controller 2
      |                                |     /Y3 .. /CS on controller 3
       --------------------------------      
        01  02  03  04  05  06  07  08       or, if A2 -> Vdd: /Y4-/Y7 are used instead of /Y0-/Y3
        |   |   |   |   |   |   |   |        
                    __  __      __  
        A0  A1  A2  E1  E2  E3  Y7  GND      /E1,/E2,E3 .. according to datasheet (/E1,/E2 -> GND, E3 -> Vdd)
    
  • 74LS42 or similar:
    different pin-out than 74HC138 but comparable functionality
top ^

passing options through serdisp_init():

intro

using the third parameter of serdisp_init(), driver specific options and custom wiring can be set.
common information about passing options and customisable wiring can be found in a separate document.
    examples:
    
      serdisp_init(sdcd, "KS0108", "WIDTH=256");
      serdisp_init(sdcd, "KS0108", "W=256;DELAY=1");
    

options

identifiershortremarkdefault
WIDTHWwidth of display128
HEIGHTHheight of display64
ROTATEROTrotate display (1 == 180 degrees)0
INVERTINVinvert display0
DELAY delay after each write/read operation.
  0 .. no delay
  1 .. one call of gettimeofday()
 >1 .. delay at least x nanoseconds
     
180
WIRINGWIREpre-defined or customisable wiring0

ranges, aliases

identifierrangealiases
WIDTH64, 128, 192, 256 
HEIGHT64 
ROTATE0, 1, 90, 180, 270YES=180, NO=0, TRUE=180, FALSE=0
INVERT0, 1YES=1, NO=0, TRUE=1, FALSE=0
DELAY>= 0NONE=0

pre-defined wiring definitions

identifiernumeric idprotocoldescription
Standard0PARStandard wiring

display signals

identifierdescriptionmandatory
D0 - D78 bit wide data bus*
A0 or RSdata or command*
CS1first chip select input (or multiplexer 1st selector)*
CS2second chip select input (or multiplexer 2nd selector)
EN or Eenable signal*
top ^

links:

controller KS0108
technical reference local copy of KS0108 technical reference (english) ks0108b.pdf
top ^

history:

2009-12-02 description for standard wiring corrected (thanks to Tommy for finding this error)
2009-11-07 typos corrected: 74HC128 -> 74HC138 (diagram was right but description was not)
2008-07-24 first release of hardware page
top ^

design by wolfgang astleitner, (C) 1998 - 2009