The 128 x 64 graphics displays (GLCDs) like JHD12864 and other use KS0108 as the display controller. In this tutorial we will look at interfacing such a display with Explore M3. We will be using a graphics library written by Michael Margolis.

Hookup

The pinout may differ according to the make of the LCD. For this sketch to work ensure that the pins are connected in the following manner. If you wish to change the pin configuration, it can be done in KS0108_pins.h file.

Display Explore M3 Description
D_I 2 Data direction or Register Select
R_W 3 Read/Write
EN 4 Enable
D0 5 8 bit Data Bus
D1 6
D2 7
D3 8
D4 9
D5 10
D6 11
D7 12
CSEL1 13 Chip select 1
CSEL2 14 Chip Select 2

Since there are numerous connections and few passive parts to set the contrast and negative voltage etc. I will be using the LCD breakout board and the JHD12864 display that we see at our EE Store.

KS0108 m3 bb.jpg

Code

I will be using the demo code in the library which shows various shapes fonts and objects. This comes with the library itself.

Demo

0-M3-glcd-demo.JPG