Graphic LCD memberikan lebih banyak pilihan character yang ingin dipaparkan berbanding Character LCD. Salah satu GLCD adalah menggunakan controller KS0108. Antara saiz pixel GLCD ini adalah 128X64. GLCD KS0108 mempunyai 20pin. Di bawah adalah gambar GLCD KS0108.
Di bawah adalah skematik untuk GLCD KS0108.
Lihat document di bawah untuk instruction GLCD.
Berikut adalah videonya.
PIC Source Code
/*
Project: GLCD KS0108 Lesson, 128X64 GLCD Example
Programmer: Shahrulnizam Mat Rejab
PIC (Crystal Frequency):
PIC16F877A (20MHz), PIC16F887 (20MHz), PIC16F1939 (Internal 32MHz)
PIC18F4520 (10MHz), PIC18F4550 (10MHz), PIC18F46K22 (Internal 16MHz)
Compiler: HI-TECH C for PIC10/12/16 V9.83, PIC18 V9.80
Last Modified: 28 October 2014
Website: http://shahrulnizam.com
*/
#define KS0108
#include "LibraryHardware.h"
#include "LibraryChar.h"
#include "LibraryUniversalDisplay.h"
#include "LibraryDataImg.h"
void setup()
{
initialize();
TRISA=0b00000000;
TRISB=0b00000000;
TRISC=0b00000000;
TRISD=0b00000000;
TRISE=0b00000000;
BUZZER=1;
glcd_init();
}
void loop()
{
int i,j;
for(i=0;i<8;i++){
glcd_goto(i,0);
for(j=0;j<64;j++) glcd_write(img1[128*i+j]);
glcd_goto(i,64);
for(j=64;j<128;j++) glcd_write(img1[128*i+j]);}
delay(1000);
for(i=0;i<8;i++){
glcd_goto(i,0);
for(j=0;j<64;j++) glcd_write(img2[128*i+j]);
glcd_goto(i,64);
for(j=64;j<128;j++) glcd_write(img2[128*i+j]);}
delay(1000);
}
37 responses to “PIC Lesson: LCD KS0108”
dimana saya boleh dapatkan file
#include “LibraryKS0108.h”
#include “LibraryImage128x64.h”
Terima kasih
faiz, header file disini.
Salam En Shahrul,
Boleh saya tanya, adakah cara initialize untuk PIC32 sama mcm ni jugak?sebab saya dah try initialize tp tak dapat.xtau apa masalahnya.Susah nak jumpa sample yg guna PIC32 yg connect dgn GLCD..
Mohon Encik sudi jawab ye..
ws Suhaila. Saya x tahu initialize PIC32 lg.
Wasalam encik nizam..
boleh x bagitau saya kat maner nak dapatkan lcd nie kat malaysia..?
dan angaran harga lcd tersebut…
terima kasih atas tutorial diatas 😀
Acap, LCD ni saya beli online kat ebay.com. Harga dlm RM60.
salam…saya nk tnye, same x pin glcd ks0108 dengan HD61202??
ws, miss. Pin x sama, bandingkan pin GLCD di atas dgn pin Character LCD.
I have tried your code with 8mhz crystal on mikroelektronikas easypicv7
i have rearange pins as
Rb5 rst
Rd pins data
Rb4 enable
rb3 rw
rb2 rs
but when i run it on demoboard even backlight of glcd goes off
could you help me please
it is urgent
best regards.
murat, you try-and-error again. I’m not helping for free, I’m also have my own project.
from turkey
hello shahrul,
May i know how many days it took for them to deliver the glcd from ebay since you ordered? Do you have another piece of that glcd for sale, i would like to have it for my final year project. Nice post anyway…
Regards
Hello Navin Raj, bought at ebay, get that in 2 weeks.
Thx for the reply bro…
May i buy the glcd from you just in case if you are not using it. Actually i urgently need that type of glcd…
Cannot, I’m not selling components.
Assalamulaikum, En.Shahrul boleh k klu sy guna GLCD jenis lain tp guna prinsip programming yg en.shahrul guna?
w/salam, Khai. GLCD ada mcm2 jenis controller. Hanya GLCD dgn controller KS0108 yg boleh guna program di atas.
Ha3… sy dah terbaca smlm sal dia punya controller, tp skg ne sy punya GLCD berbeza Pixel.. still boleh apply programming 2 kn.
Boleh.
Trima Kasih En.Shahrul…
Assalamulaikum, En.Shahrul sy ada go through header “LibraryUniversalDisplay.h” dlm slot Header… kebanyakan coding 2 sy faham. Yg sy x faham adalah function glcd_gotox(unsigned char c); glcd_gotoy(unsigned char c); glcd_gotoz(unsigned char c);
w/salam, Khai. Faham kan lagi, rujuk datasheet. Saya pun x pandai nak terangkan.
Assalamulaikum, Sy dah faham ape function coding 2… tp sy nak tanya gak le, coding ne bukan terus boleh tulis text kat mane2 location dlm GLCD 2 kn…
w/salam. Nak tulis text dan nombor, saya belum buat function glcd_string dan glcd_number.
Ok, tq coz kongsi ilmu
Salam, example code for graphic lcd is not included, where can i get that?
w/salam, Irfan. The code was included.
Salam en.shahrul….glcd controller KS0108 compatible x ngn glcd S6B0108?tq.:)
Hey man, I saw that you have been made a very nice job, but I didn’t see where is the link that you share your codes with us. It is possible or you don’t do this anytime. Thanks a lot!
Eduardo, I’m not giving free source code anymore.
Sorry Shahrul, thanks for your reply. I asked that because I saw some comments below about the code, but how much a code like this example with source.h and source.c cost?
Eduardo, please e-mail me at Tentang Saya.
Please give me the header files for graphical lcd
hi can you please send me your library files
#include “LibraryHardware.h”
#include “LibraryChar.h”
#include “LibraryUniversalDisplay.h”
#include “LibraryDataImg.h”
Hello,
is it possible to get header files please?
This library is what I’m looking for.
Thanks.
Hello ,
I need graphic LCD lib files in mplab. Any one help me
You need to write your own code