Go Down

Topic: Graphic LCD (KS0108) library now available (Read 134677 times) previous topic - next topic


Got some supply of KS0108 LCDs, check them out if they would be helpful: http://www.seeedstudio.com/depot/parts-lcd-c-32_8.html


I downloaded the KS0108 library and it works like a charm with my type B 'ATM12864D' LCD.
Thanks for the good work on converting it to be Arduino friendly :-)

After looking at the code of the library I discovered that in many of the functions there is a call to a function ReadData(). This function is also used in the WriteData() function.
What data arrives from the LCD and why is it needed?
Is this data vital to be able to send the correct commands to the LCD or would it be possible to use a one way communication (meaning never read from LCD, only send to it)?


Hi Frisken, good question, here is the answer.

Each write to the lcd  affects 8 pixels. But when setting a specific pixel, the state of the other 7 pixels need to be known so that the value of the unchanged pixels can be re-written. That's what the read is for, there  isn't enough RAM on the Arduino to store the state of the entire display.  


Ok, I see.
Theoretically if I clear the LCD before each update and never write the same 8 pixels area twice it should be possible to update the LCD without reading from it.
Is the 8 pixels vertically or horizontally added to the display area?


The data is written in vertical blocks of 8 pixels. If you only ever write to any of the 8 adjacent pixels once, then you don't need to read the LCD data.

The actual architecture of the LCD controller uses the concept of vertical pages, a 64 pixel high panel has 8 pages. Vertical pixels 0-7 are on page zero, pixels 8-15 page one etc. So again, if you only write once per page to a specific x address then you don't need to read the data.

Hope that helps.

I am curious to know what your application is?


Hehe, well there is not much of an application yet (almost only your library code and a small testapp). I am thinking on using a 74HC595 IC for sending the data to the LCD.
This will save 5 pins on the arduino hence the 595 IC only needs 3 pins to send 8 bit parallel but it can not receive any data.
I will only present text and numbers on the display and therefore I don't think that I will need to write the same 8 bit part more then one time for each update.

The project is to control the cooling fans in the computer depending on the heat to make it as quiet as possible. I got the idée from a friend that used the arduino in another project of his. It seemed to be easy to use and a lot of projects were already available on the net.
It would be nice with a GLCD to show values and to manually change some fan and heat limits.

I started with the GLCD because it seemed like it would be the most difficult part in the project.


Due to a shipping error I now own a graphic LCD, but it doesn't look like the right kind to use with the Arduino.


I think I could deal with the 3.3v power, but the different controller is probably a deal killer.


Due to a shipping error I now own a graphic LCD, but it doesn't look like the right kind to use with the Arduino.

It won't work with the KS0108 library but you may be able to get it to work if you can find some AVR code for your controller, try a search on the controller: ST7565 or ST7565R

Good luck!


Oct 23, 2008, 10:39 pm Last Edit: Oct 23, 2008, 10:39 pm by HULK Reason: 1

I have tested my new KS0108 LCD from Seeedstudio and can say that it works good with the Library.
So you could add it as a tested unit in the playground area.
I am not really sure what the brand is but i think Eric at seeedstudio could provide us with an seeedstudio artical number that can be used or point out the product name.
Could it be called the bluemoon lcd ?
Datasheet i have is found here: http://www.bluemoon-lcd.com/english/pdf/G12864C.pdf

I am runnig the following setup for smooth displaying:
#define DELAY_EN_ON  0  
#define DELAY_EN_OFF 15

My other one from http://www.fractronics.com/12864b_full.pdf had to be set as you know to as slow as:
#define DELAY_EN_ON  0  
#define DELAY_EN_OFF 27

Eric, at what settings did you manage to run the same lcd before shipping to me?

The green one from ebay that we have Mem is running at:
#define DELAY_EN_ON  4
#define DELAY_EN_OFF 6
I do ask my self why the above two have to be slowed down to a big enable off value but not on the enable on value.

Maybe something that will be solved when and if there will be an automized set up of speed in your library?


HULK - It's the right datasheet you have found.

While we test the LCD, it's not displaying good for the spinning lines. I didn't change the settings, but added delays as discussed in some posts here until we see it work fine. FPS=6

Thanks for the review:)


Oct 24, 2008, 06:14 pm Last Edit: Oct 24, 2008, 06:15 pm by HULK Reason: 1
After some more testing i got the lcd to work with following settings:
FPS = 2
#define DELAY_EN_ON  15
#define DELAY_EN_OFF 0

FPS = 2
#define DELAY_EN_ON  0  
#define DELAY_EN_OFF 15

FPS = 1
#define DELAY_EN_ON  0  
#define DELAY_EN_OFF 0

Strange thing is that this was tested by seeedstudio but with ATMega 168 i assume and FPS was 6.
I will do some more testing with my ATMega644 and maybe also connect it to a ATMega 168 to check.


hmmm, could it be the ports that i am using
//bits 0-7 assigned to sanguino pins 0-7


Hello all,
Just wondering if anyone has tested or gotten to work the Graphic LCD from Sparkfun.
part # LCD-00710

My GLCD has garble even though I checked every connection at least 4x and followed the KS0108 Graphics LCD library page carefully.  
I'm using the example code given on the Arduino library page.



Nov 01, 2008, 09:23 am Last Edit: Nov 01, 2008, 09:25 am by HULK Reason: 1

If this is a KS0108 panel i am sure you will get to work.

Have you tested to add more "nop\n\t" to the ks0108.cpp file, any diffrence?

I had some trouble with one of my panels as you can read in this thread and in the end i got it working using a new updated KS0108 library.
If you wait for couple of days i am sure that mem will realese this updated version so it can be downloaded and used.
He is working on it right now and have improved it so it will adjust according to your panel hardware speed.

But then i am not the one to say what mem will do and not   :) .
I am sure he will jump in this thread soon and give us all more news on the updated version.

Go Up