5 years ago.

KS0108B display and Nucleo F401RE

Hi, I've been trying to use this library

Import libraryDisplay

128x64 grafical display with KS0107B and KS0108B controller

with a Nucleo F401RE and this display https://www.sparkfun.com/products/710

This is my test code:


#include "mbed.h"
#include "KS0108.h"  
#include "Arial12.h"
#include "Arial14.h"
#include "Comic24.h"
#include "vivaldi16.h"

// (_RST,_DI, _RW, _E, _CS2, _CS1, DB0, DB1, DB2, DB3, DB4, DB5, DB6, DB7)
//KS0108 display (PB_13, PB_14, PB_15, PA_3, PA_2, PC_4, PC_3, PC_2, PH_1, PH_0, PA_10, PB_3, PB_5, PB_4);                        
KS0108 display (A2, A4, A3, A5, A0, A1, D7, D6, D5, D4, D3, D2, D1, D0);                        

int main() {
        display.PrintString("arial Font test");            
        display.PrintString("Vivaldi font");    


this is a picture of the wiring: /media/uploads/esistgut/img_20141008_115205.jpg

and this is a picture of the result: /media/uploads/esistgut/img_20141008_110737.jpg

What could I be doing wrong?

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F401RET6 microcontroller.

Sorry, I linked the wrong library, this is the one I am using: http://developer.mbed.org/users/DimiterK/code/KS0108/

posted by Giacomo Graziosi 08 Oct 2014
Comment on this question

2 Answers

5 years ago.

First thing is to check the wiring (and then check again and maybe once more...). You may also want to look at D0, D1. Default these pins are not connected on the nucleo since they are used for the serial port between the F401 and the STLink interface part. You should replace these by other pins unless you have modified the related solderbridges on the nucleo board.

Ok, following your hint I moved D0 and D1 to PH_0 and PH_1 and I'm starting to see something that makes sense: /media/uploads/esistgut/img_20141008_145844.jpg Still there is something wrong about the order it is showing the content...

posted by Giacomo Graziosi 08 Oct 2014

The CS1 and CS2 pins/wiring is wrong. Reverse the wires. This display actually has two controllers. One for the left hand side of the display and the other for the right hand side. That should do it.

posted by Wim Huiskamp 08 Oct 2014
5 years ago.

this LCD work with 5V

Use output with Open Drain (i am make custom library to resolve similar problem with 5v quadrature encoder chip)

check tensions with oscilloscope