
KS0108 GLCD Library for Proteus Simulation

Hello friends, I hope you all are doing great. Today, I am going to share the new KS0108 GLCD Library for Proteus Simulation. The 128 x 64 graphic LCD with the KS0108 controllers is the classic big screen of Arduino projects: 93 x 70 mm, a yellow-green or blue glass with a backlight, and an 8-bit parallel bus. It is not hard to drive, but it has a few habits - two chips, a busy flag and the dummy read - that confuse everyone the first time. With this library you can run a full Proteus simulation of the module and watch every one of them.
KS0108 GLCD Library for Proteus
Latest version: V1.0 (December 2026, this tutorial)
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
The demo drives the GLCD from an Arduino UNO V4.0 with a small driver of its own: a sine wave drawn dot by dot, a counter across both halves, the hardware scroll and the display off and on.
NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the LCD board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the KS0108 GLCD Library for Proteus Simulation:
What Is the KS0108 GLCD?
The module is a monochrome LCD with 128 x 64 dots. Behind the glass sit three chips: two KS0108 column drivers - one for the left 64 columns, one for the right 64 - and a row driver that the user never talks to. The board also makes the negative voltage the glass needs and carries an LED backlight.
- The board: 93 x 70 mm, four 2.7 mm holes on 88 x 65 mm centres, the 20-pin header along the top.
- The glass: a 72 x 40 mm viewing area, dots of 0.48 mm on a 0.52 mm pitch.
- Yellow-green (dark dots) or blue (white dots on blue).
- Supply 5 V, about 11 mA without the backlight; the backlight takes far more.
- An 8-bit parallel bus with read and write: D/I, R/W, E, DB0 - DB7, CS1, CS2 and /RST.
The 20 Pins
The most common order is: 1 VSS, 2 VDD, 3 Vo (contrast), 4 D/I, 5 R/W, 6 E, 7 - 14 DB0 - DB7, 15 CS1, 16 CS2, 17 /RST, 18 VEE (about -10 V out), 19 A and 20 K (the backlight). Some modules put CS1 / CS2 at pins 1 and 2, and a third order exists, so always check the sheet of your module. The contrast needs a 10k trimmer: its wiper to Vo, its ends to VEE and GND.
Two Chips, Pages and Columns
Each KS0108 holds 512 bytes: 8 pages of 64 columns. A byte is a column of 8 vertical dots inside a page, the lowest bit at the top. Dot (x, y) on the module is in the left chip for x below 64, the right chip from 64; its column inside the chip is x % 64, its page y / 8, its bit y % 8. CS1 and CS2 select the chip - on most 93 x 70 boards with a HIGH level, on some with LOW.
The Instructions
- 3E / 3F: display off / on - the RAM keeps the picture.
- 40 | Y: the column, 0 - 63. It moves on by itself after every data write or read.
- B8 | page: the page, 0 - 7. It never moves on by itself.
- C0 | line: the display start line - the RAM row shown at the top. Changing it scrolls the picture without touching the RAM.
- Status read: BUSY (bit 7), ON/OFF (bit 5, 1 = off) and RESET (bit 4).
- Data read: returns the output register - which is why a dummy read is needed.
BUSY and the Dummy Read
After every instruction or data byte a chip is busy for a few microseconds and ignores anything else - so a driver either polls the BUSY flag or waits. Reading is the other trap: a data read returns the output register, which is filled from the RAM by the read before it. The first read after setting the address therefore returns old data - the dummy read - and only the second returns the byte. The KS0108 has no "set one dot" command, so drawing a single dot is a read-modify-write: set the address, dummy read, read, change one bit, set the address again and write.
Features of the KS0108 Library
- A real-looking module: the 93 x 70 mm board with its 20-pin header, the bezel and the glass at true size; the picture shows on the sheet in yellow-green or blue.
- Two chips: each with its own RAM, address, on / off and start line.
- The bus of the datasheet: writes on the falling edge of E, reads 320 ns after E rises, the busy time, the status bits, the dummy-read pipeline, CS polarity.
- Faults caught: accesses while busy, both chips selected on a read, timing below the datasheet, a short /RST pulse.
- The analog side: the contrast from VDD - Vo, the -10 V output for the trimmer, the backlight LED.
- Simple and Advance: an on-sheet status panel, or a pop-up with the glass, both RAMs, a decoded Bus log and Tests for the start-up, the bus timing, BUSY and the reads, and the pixels.
- A complete package: about 1.6 MB with the library, the contrast trimmer, our Arduino UNO V4.0 and the demo, without the source code of the model.
The KS0108 GLCD in Proteus
The library has two devices in TEPKS0108.LIB with the model TEPKS0108.DLL: GLCDKS0108TEP (Simple, with the on-sheet status panel) and GLCDKS0108ADVTEP (Advance, with the pop-up). Search KS0108 in Pick Devices. The 20 pins are in the common order above; the properties are CSACTIVE (HIGH or LOW) and GLASS (yellow-green or blue).
Download KS0108 GLCD Library for Proteus Simulation
Click the button below to download KS0108-GLCD-Library-for-Proteus-v1.0.zip (about 1.6 MB, without the source code of the models):
KS0108 GLCD Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPKS0108.LIB,TEPTRIM.LIBandArduinoV4TEP.LIB. - Proteus Model Files:
TEPKS0108.DLL,TEPTRIM.DLLandTEPARDUINO.DLL. - Arduino Code: the demo sketch.
- Proteus Simulation: the demo project, its HEX file and copies of the DLLs.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install KS0108 GLCD Library for Proteus Simulation
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Delete
TEPKS0108.IDXfrom the LIBRARY folder if it is there. - Start Proteus, press P and search for KS0108.
Proteus Simulation of the KS0108 GLCD on an Arduino UNO
The demo uses an A4 sheet with our Arduino UNO Library for Proteus V4.0, the GLCD LCD1 and the 10k contrast trimmer RV1. The wiring is the classic UNO pin map: DB0 - DB3 to D8 - D11, DB4 - DB7 to D4 - D7, CS1 to A0, CS2 to A1, R/W to A2, D/I to A3, E to A4 and /RST to A5. The trimmer's wiper goes to Vo and its ends to VOUT (pin 18) and GND; VDD and A go to 5 V, VSS and K to GND. The module is bigger than the UNO, as the real one is. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open KS0108-GLCD-ArduinoUnoV4.pdsprj.
The Sketch
The sketch uses no GLCD library: a few functions are the whole driver, so every step of the protocol is in the code. A write puts D/I and the byte on the bus and pulses E - the chip takes the byte when E falls:
digitalWrite(DI, di);
for (uint8_t i = 0; i < 8; i++) digitalWrite(DB[i], (v >> i) & 1);
digitalWrite(EN, HIGH);
delayMicroseconds(1); // E high >= 450 ns
digitalWrite(EN, LOW);
An address picks the chip first, then the page and the column:
chip(x < 64 ? LEFT : RIGHT);
writeByte(0, 0xB8 | page); // SET PAGE (X)
writeByte(0, 0x40 | (x & 63)); // SET Y (column) - it moves on by itself after every byte
And one dot is a read-modify-write with the dummy read:
command(c, 0xB8 | page); // the page (X) = y / 8
command(c, 0x40 | col); // the column (Y)
waitReady(); readByte(1); // the DUMMY read: the old output register; RAM[page][Y] goes into it
waitReady(); uint8_t b = readByte(1); // now the byte itself (Y has moved on twice)
if (on) b |= 1 << (y & 7); else b &= ~(1 << (y & 7));
command(c, 0x40 | col); // the reads moved Y: set it again
waitReady(); writeByte(1, b); // and write the byte back
Note the second SET Y: both reads moved the column on, so it has to be set again before the write.
KS0108 Simulation Results
Open the project and press Run. The demo ran 10.2 simulated seconds and took about 2 minutes 35 seconds on our PC with the pop-up open and the pictures being taken. Click OPEN PANEL on the module for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
The Start-Up and the Sine Wave
At 0.5 s the start-up is done and the picture is complete: the title bar with the text cut out of lit dots, the frame with the dotted CS1 / CS2 border and the axis, the sine wave and the label line with the counter at 00000. The tiles show both chips ON, start line 0 on both, the contrast VDD - Vo = 9.89 V (GOOD), pin 18 at -9.80 V and the backlight at 139 mA. Under the glass the pop-up draws the two RAMs as stored, the left chip and the right chip side by side. So far the sketch has sent 425 instructions and 1656 data bytes, read the status 749 times and the data 245 times - 123 of them dummy reads.
The Counter Across Both Halves
At 2.0 s the counter reads 00003. The latest transfers show what the label line costs: the left chip gets SET PAGE 7, SET Y 49 and 14 bytes, then one more byte at Y 63 - after which its Y wraps round to 0 on the same page - and the right chip gets its own SET PAGE 7, SET Y 0 and the remaining 15 bytes. Every text or line that crosses the middle of the glass has to be split like this.
The Hardware Scroll
At 4.35 s the sketch starts the hardware scroll: START LINE goes from 0 to 63 on both chips, one line every 16 ms. At 4.6 s the start line is 13 - the picture has moved up 13 rows and the top rows have come round at the bottom. The RAM view below is unchanged: the start line only changes which RAM row the glass shows first. At 5.35 s the start line is back at 0.
Display Off and On
At 6.77 s the sketch sends 3E to both chips: DISPLAY OFF. At 6.9 s the glass is blank, the tiles read L OFF and R OFF and the status bar says "Display off (send 0x3F)" - but the RAM view still holds the whole picture, counter 00013.
Half a second later 3F switches both chips on again and the picture is back at once, straight from the RAM: at 7.5 s the counter reads 00014. Nothing had to be redrawn.
At 10.2 s the counter is at 00020. The totals tell the story of read-modify-write: 6757 instructions, 4318 data bytes written, 13121 status reads and 4370 data reads - 2185 of them dummy reads, one for every dot the wave moved.
The Bus Log and the Tests Page
The Bus log lists everything the two chips took, newest first, L for CS1 and R for CS2. Here the counter update at 10.07 s and, below it, the wave being moved dot by dot: SET PAGE, SET Y, a status read, the DUMMY READ (the old output register), another status read, the DATA READ, SET Y again and the byte written back.
The Tests page checks the start-up against the KS0108 datasheet, and every row is green: VDD 5.00 V, the contrast 9.89 V, pin 18 at -9.80 V with 0.98 mA into the trimmer, a /RST pulse of 1.067 ms (1 us needed) 65.6 ms after power-on, both chips ON with start line 0, CS1 the left half and CS2 the right half active HIGH, the BUSY flag polled 13121 times - 6 answered BUSY, nothing lost - and the whole RAM written. Below, the start-up as the sketch sent it: the reset, the status reads, the start lines, and the clear with both chips selected at once, each page ending with the Y wrap.
The Arduino's built-in serial monitor prints each step with its time from millis(), which starts with the sketch, about 66 ms after power-on: the reset ready after 2 status reads, the busy test with BUSY read 6 times after one instruction, the 126 dots of the wave, the dummy read (1st FF - the old output register, 2nd 49 - the RAM byte), the scroll, the display off and on, and at 10 s the totals.
Which Display?
For text only, the character LCD in our LCD 16x2 Library for Proteus needs fewer pins. The small 84 x 48 graphic screen in our Nokia 5110 LCD Library for Proteus runs on SPI with five wires. And for a sharp, self-lit 128 x 64 picture on SPI, see our SSD1309 OLED Library for Proteus. Pick the KS0108 when you want a big, cheap screen that is readable in daylight and you have the pins for it.
Try It Yourself
- Remove the dummy read from setPixel: the wave comes out wrong, because every byte written back is the previous one.
- Set CSACTIVE to LOW without changing CS_ON in the sketch: the wrong chips are selected and nothing appears.
- Turn RV1: below about 7 V of VDD - Vo the glass goes blank, above 10.8 V it turns dark.
- Give the two chips different start lines: the halves shear apart.
- Remove waitReady() from the drawing and write at port speed: the Bus log counts the bytes ignored while BUSY.
Ideas to Extend the Demo
- A data logger plotting a sensor across the screen.
- A menu system with inverted text for the selected line.
- A scrolling news ticker with the start line.
Your Own Sketches
The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.
Things to Know Before Using a Real KS0108 GLCD
- Pinout: three orders exist - check your module before wiring.
- CS polarity: HIGH on most boards, LOW on some.
- Contrast: without the trimmer between VEE and GND the glass stays blank.
- Backlight: it can draw well over 100 mA; check whether your board has a resistor, or add one.
- Pins: 14 signal pins - an UNO has few left for anything else.
Troubleshooting
- Nothing on the glass: no 3F, the contrast, /RST held low, or the CS polarity.
- Only one half works: CS1 / CS2 swapped, or one of them on the wrong level.
- Wrong dots after drawing: the dummy read is missing.
- Missing bytes: written while BUSY.
- The part is not simulated:
TEPKS0108.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The instructions, the status bits, the dummy read, the bus timing and the module's size follow the KS0108 datasheet and the module data; the module is our own drawing.
- Our own figures: the contrast thresholds, the VEE output resistance, the power-on reset time, the header position.
- Not modelled: the row driver's own signals, the contrast's temperature drift, the glass's response time.
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the makers of the chips or the module.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the KS0108 GLCD Library for Proteus Simulation. I hope it helps you put a big graphic screen on your next project. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!






















Comments
0