Go Down

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


Hello there,

I bought Futurlec BLUE128X64LCD LCD (type B pinout), but I cannot make it work with my Arduino. The backlight is lit up, but there is nothing on the screen. I also cannot adjust the contrast. I've noticed on the Wiki page that the the third leg of the contrast potmeter is connected to the ground. According to the datasheet of Lumex LCM-S12864GSF (another LCD with type B pinout), it should be connected to 5V. Well, I tried in both way (which I probably shouldn't have) but it didn't work anyway. How much voltage should actually be present at pin 18 (Vee)?



Hi Karoly!
I can only speak for what I did and I connected it to the ground and to pin #3 and #18 on the GLCD as in the picture in the ks0108 playground. I also use the B pinout but the contrast is the same in both pinouts. I had to turn the variable 10K resistor to almost 0 before I got anything on the GLCD. Set it to 0 and very slowly increase the resistance. I discovered that the contrast has to be correct otherwise the GLCD shows nothing.
I do not now how much voltage there should be on pin #18. The measurement I got was 9V. That was a surprise for me because I only have 5V in.


I created a new public function in the ks0108 library that calls the private function WriteData like this.
Code: [Select]

void ks0108::WD(uint8_t data)

I just wanted to try and add a B/W image of my youngest daughter using this function. Guess what, it works. There is no problems with the border between the two controller chips. I tested it with lines, circles, squares and text both inverted and not, no problem.


Thanks for your reply, Frisken! I can only measure 0.5V on pin 18. I guess that is why I can't see anything on the screen. It seems I got a faulty unit or I killed it somehow.  :(


I can only measure 0.5V on pin 18. I guess that is why I can't see anything on the screen. It seems I got a faulty unit or I killed it somehow.  

I can recommend you to check and recheck the connections according to the B pin out because in my own experience I checked the pin out many times and still some small faults had slipped in.


I got a LCD from Ebay with type B pin out. It works with Atmega8 except 2 issues.

1) When the 10th PIN of LCD is connected with the 11th pin of arduino (PB3 of Atmega8) I cont upload the files to Atmega8. If i do i get an error as follows:
avrdude: verification error, first mismatch at byte 0x0000
        0x4c != 0x00
avrdude: verification error; content mismatch

But when i disconnect the above specified connection the uploading is not a problem at all.

2) I get some extra characters above and below the the actual location of the text. For example if i write "Test" at 20,30 i get T at 20,50 e at 27, 10 something like that.  ::)

Is my LCD is not good or is it Atmega8 specific issue(s).


only pins 0 and 1 should affect uploading using the serial port. Connection to pin 11 should not be a problem - check that there is not short circuit on you board that has pin 11 connected to pins 0 or 1.

The extra characters are probably caused by your LCD not reacting fast enough to the signals so its occasionally writing pixels in the wrong place. This seems to be more likely in type B panels. There have been a few suggestions for slowing down the library for these panels that was discussed in earlier posts.


I am not using Arduino board. I am using an Atmega8 in Arduino environment without a bootloader. So, I am using Usbtiny to program via the ICSP Header which uses pin # 17 of Atmega8 (pin 11 of Arduino)...

I will reduce the speed as described previously and try to solve the extra character problem...



I am using Usbtiny to program via the ICSP Header which uses pin # 17 of Atmega8 (pin 11 of Arduino)...

The easiest thing to fix the upload is to connect the wire to pin 11 so it can be easily disconnected when using ICSP.  But you could also try to re-assign the data pins to avoid pin 11.
If you are not using the uart, you can use the dataPins0to3 #define  in the header so that data is on pins 0-7.  You comment out dataPins8to11 and uncomment dataPins0to3 in ks0108.h. delete the ks0108.o file and rebuild the sketch.


Good luck, bear in mind that hardware serial won't work if you use pins 0-3 for data.


Jan 17, 2009, 07:30 pm Last Edit: Jan 17, 2009, 07:36 pm by santy Reason: 1
Hey Guys..

My first post.. :-)

Thanks for the nice library and instructions. They are awesome.

I got a AZ displays AGM1264F LCD from Tanner Electronics. It works beautifully with the KS0108 lib.

In the LCD spec sheet the power circuit was a bit confusing. I checked out a similar project (a PIC oscilloscope using the same LCD) and copied it. It powered up nicely. :-)  This is the url if anyone needs it :

I wired the data and control wires according the playground wiki page and it sprang to life...I had to adjust the delay to get it to display properly. I updated the playground wiki page with the model of the LCD.

Awesome job everyone. And special thanks to mem for the lib and the wiki page.

Some pics here:



Jan 17, 2009, 07:57 pm Last Edit: Jan 17, 2009, 07:57 pm by mem Reason: 1
santy, good to hear you have it going. Thanks for updating the playground with info on that panel.

Have fun!


"hardware serial won't work if you use pins 0-3 for data." !!! Does this mean that any open digital pins cannot be used for I/O because they're part of the port setup?  (0-3, 12,13)   :o


"hardware serial won't work if you use pins 0-3 for data.

it means that you should not connect the LCD to pins that are used for the serial port. pins 0-3 can only be used on a board that does not have the serial hardware connected to pins 0 and 1.

I don't understand the rest of your question, what do you want to do?

Go Up