PDA

View Full Version : Graphic LCD with PICbasic pro



amindzo
- 6th November 2008, 21:39
Hi,i want to learn how can i write on graphic LCD? How can i make custom characters? How can i make new fonts in other languages? This is may first time. I bought TS12864A-2 v1.1 graphic LCD.I use PICbasic pro 2.5 and PIC16F877A.

mister_e
- 6th November 2008, 21:45
first of all, you need to know which controller type your LCD use, here, it seems to be a KS0108.

From there, you download the usual datasheet, and try to understand how it works.

A swear jar is recommended, not a so easy task... have done it before... still trying to recover it, or redoing it from scratch next week or so.

amindzo
- 7th November 2008, 09:46
I can not find the complete datasheet of the LCD.could you send me a PDF file or website that can help me with graphic LCD in PICBasic(PIC projects with graphic LCD)?

Jerson
- 7th November 2008, 10:21
Search for CrystalFontz LCD. They have the range of monochrome LCD panels with data sheets if thats what you're using.

Acetronics2
- 7th November 2008, 10:30
Hi, Jerson

I'd better bet on : " SHENZHEN TECHSTAR ELECTRONICS CO.,LTD "

Alain

http://www.datasheet4u.com/download.php?id=553270

Jerson
- 7th November 2008, 12:58
Yes ofcourse Alain. Most stuff comes from China anyway :D

mister_e
- 7th November 2008, 15:07
I can not find the complete datasheet of the LCD.could you send me a PDF file or website that can help me with graphic LCD in PICBasic(PIC projects with graphic LCD)?
Assuming I'm right, KS0108 controller, 128x64 GLCD type, the following datasheet should be handy
http://circuit-ed.com/uplds/GDM12864B.pdf

and then maybe this link too
http://www.compsys1.com/workbench/On_top_of_the_Bench/KS0108/ks0108_controller.html

Acetronics2
- 7th November 2008, 15:21
Assuming I'm right, KS0108 controller, 128x64 GLCD type, the following datasheet should be handy
http://circuit-ed.com/uplds/GDM12864B.pdf

and then maybe this link too
http://www.compsys1.com/workbench/On_top_of_the_Bench/KS0108/ks0108_controller.html

May be A types have a different pinout ... ( A -2 means w/backlight ! )

Alain

mister_e
- 7th November 2008, 15:23
Maybe, but the above also have it !

amindzo
- 7th November 2008, 15:57
This is a 20 pin LCD from TECHSTAR company.

mister_e
- 7th November 2008, 16:04
http://techstarlcd.en.makepolo.com/productshow/4519176.html

this is for TS12864A-1 but it shows it's really a KS0108 controller type.

So, i'm pretty confident of my links few post above.

amindzo
- 7th November 2008, 16:41
Hi, i think this pdf file is very useful for me,do you think so or u have something better than this?
http://www.picbasic.it/it/CRN-12864C.pdf

amindzo
- 7th November 2008, 17:29
i found another one,what about this?
http://www.electro-tech-online.com/attachments/micro-controllers/23557d1226073317-graphic-lcd-picbasic-pro-12864_datasheet.pdf

mister_e
- 7th November 2008, 18:34
Hi, i think this pdf file is very useful for me,do you think so or u have something better than this?
http://www.picbasic.it/it/CRN-12864C.pdf

This is for Proton PDS compiler which have it built-in... of no help for Melabs PICBASIC PRO compiler.

Your second link is for T6963 controller... not much help... a far different controller

amindzo
- 7th November 2008, 21:12
could you explain more about the controllers that you said about LCD's?

amindzo
- 7th November 2008, 21:32
can i use your link?( http://circuit-ed.com/uplds/GDM12864B.pdf) to work with my LCD?
because i can't find complete datasheet of my LCD that explain everything to tell me how can i make fonts and write on LCD.

mister_e
- 7th November 2008, 21:33
There's nothing to explain... KS0108 is not a T6963 that's it. From memory.. T6963 have built-in fonts, while KS0108 don't.

Everything is in their respective datasheet, and i'd post more than enough link to get you started with your GLCD.

I will release my own KS0108 GLCD lib here probably in a week or so.. nothing free, but will be really easy to use.

EDIT: YES you should at least use my link to circuit-ed datasheet to begin.

EDIT2: thought confirm by futz

Oh! If it's a KS0108 then there is no character generator. It's all graphic. You build your own fonts and code up a way to display them.

J. Mark Wolf
- 9th November 2008, 12:05
Perhaps you should consider graphic LCD's with a serial interface. They cost more but communication is far easier, and as a bonus, these LCD's typically provide simple commands for circles, rectangles, multi-fonts, etc.

Just google for "serial graphic LCD"

JBrannan
- 10th November 2008, 10:04
Are Serial GLCD's a viable option when you want to sell lots of kit.

What about the need odd size units how do you cater for them?

IMHO its far cheaper to find a compiler that supports GLCD's or at least has access to routines that can use them.

Acetronics2
- 10th November 2008, 14:59
IMHO its far cheaper to find a compiler that supports GLCD's or at least has access to routines that can use them.

Hi,

Sooooo,

Why do you loose your precious time here ??? LOL

Good Question, no ???

My serial interface is self-made , ... so my main µP can do anything useful else than address stupid pixels ... LOL

Alain

JBrannan
- 10th November 2008, 16:44
So..... is that your answer to every one?

If some one makes a valid suggestion that in circumstances were the compiler does not suit the application its actually more economical to use another one for that job.

You then tell them to get lost?

mister_e
- 10th November 2008, 16:47
;) don't worry with Alain, must be one of his bad days ;)

Acetronics2
- 10th November 2008, 17:18
So..... is that your answer to every one?



Definitly YES !!!

IF product doesn't suit your OWN requirements ... no use to loose your time. if " Time is money " for you ...

You want what PBP doesn't offer you ... why heavily insist ???

Lots of people have asked the same question as you ... in the right Forum section. One more may decide Melabs to add GLCD to the libraries ...

Who knows ???

Now one thing is sure ... PBP allows you to create your own driver ... without too many pain !!!

Alain

amindzo
- 6th December 2008, 13:50
Hi again,imagine that i want to write "A" on this LCD,could you send me a sample code with picbasic pro that help me to know how can i work with this LCD?

amindzo
- 12th December 2008, 07:21
could you explain more about graphic LCD? what is X,Y and Z address? how can i write on LCD? how can i make custom fonts on LCD?

Jerson
- 12th December 2008, 12:57
This is not PicBasicPro code, but if you look through it, you will find exactly what you are looking for.

http://www.8052.com/codelib/files/128x64%20Graphic%20LCD%20demo.asm

amindzo
- 12th December 2008, 20:34
thanks, i will study it but i'm not good in assembly.

phoenix_1
- 12th December 2008, 21:22
Maybe is bad ....maybe it help you.
Regards


@ Device pic16F877, HS_OSC, BOD_ON, PWRT_OFF, WDT_ON, PROTECT_OFF
Define osc 20
ADCON1 = 7
trisc = $00
trisd = $00
en var portd.0
rw var portd.1
rs var portd.2
cs1 var portd.3
cs2 var portd.4
reset var portd.5
rs = 1
rw = 0
en = 0
cs1 = 1
cs2 = 1
temp var byte
x var byte
y var byte
z var byte
h var byte
x = 0
y = 0
z = 0
h = 0
gosub rst
pause 500
gosub brisanje

gosub levo
gosub nulti
temp = 184
gosub komanda
for z = 0 to 63
lookup z,[$ff,$01,$01,$01,$01,$01,$01,$01,$01,$01,$09,$09,$0 9,$09,$09,$09,$89,$69,$19,$09,$01,$01,$01,$01,$01, $01,$01,$01,$01,$01,$01,$ff,$01,$01,$01,$01,$01,$0 1,$01,$01,$01,$01,$f9,$89,$89,$89,$89,$89,$89,$89, $89,$f9,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0 1,$01,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 184
gosub komanda
for z = 0 to 63
lookup z,[$ff,$01,$01,$01,$01,$01,$01,$01,$01,$01,$f9,$09,$0 9,$09,$09,$09,$09,$f9,$01,$01,$01,$01,$01,$01,$01, $01,$01,$01,$01,$ff,$01,$01,$01,$01,$81,$81,$c1,$0 1,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$81, $e1,$f1,$e1,$81,$01,$01,$01,$01,$01,$01,$01,$01,$0 1,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
gosub nulti
temp = 185
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$9 0,$88,$86,$81,$80,$80,$80,$80,$80,$80,$80,$80,$80, $80,$80,$80,$80,$80,$80,$ff,$80,$80,$80,$80,$80,$8 0,$80,$80,$80,$80,$9f,$90,$90,$90,$90,$90,$90,$90, $90,$9f,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$8 0,$80,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 185
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$80,$80,$80,$80,$80,$80,$91,$91,$9 1,$91,$91,$91,$91,$9f,$80,$80,$80,$80,$80,$80,$80, $80,$80,$80,$80,$ff,$80,$80,$80,$81,$83,$83,$87,$8 1,$81,$81,$81,$81,$81,$80,$80,$80,$80,$80,$80,$80, $80,$9f,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$8 0,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
temp = 186
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$c0,$a 0,$90,$88,$84,$fc,$80,$00,$00,$00,$00,$00,$00,$00, $00,$00,$00,$00,$00,$00,$ff,$00,$00,$00,$00,$00,$0 0,$00,$00,$00,$00,$7c,$44,$44,$44,$44,$44,$44,$44, $c4,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$00,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 186
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$fc,$84,$8 4,$84,$84,$84,$84,$84,$00,$00,$00,$00,$00,$00,$00, $00,$00,$00,$00,$ff,$00,$00,$00,$00,$80,$00,$c0,$0 0,$80,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00, $00,$f0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
temp = 187
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$00,$00,$00,$1f,$00,$00,$00,$00,$00,$00,$00,$00, $00,$00,$00,$00,$00,$00,$ff,$00,$00,$00,$00,$00,$0 0,$00,$00,$00,$00,$20,$20,$20,$20,$20,$20,$20,$20, $3f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$00,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 187
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$1f,$10,$1 0,$10,$10,$10,$10,$1f,$00,$00,$00,$00,$00,$00,$00, $00,$00,$00,$00,$ff,$00,$00,$00,$00,$0a,$07,$1f,$0 7,$0a,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$04, $1c,$3f,$1c,$04,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$ff],temp
gosub podatak
next z

gosub levo
gosub nulti
temp = 188
gosub komanda
for z = 0 to 63
lookup z,[$ff,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0 1,$21,$31,$f9,$01,$01,$01,$01,$01,$01,$01,$01,$01, $01,$01,$01,$01,$01,$01,$ff,$01,$01,$01,$01,$01,$0 1,$01,$01,$01,$01,$01,$01,$79,$09,$09,$09,$09,$89, $79,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0 1,$01,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 188
gosub komanda
for z = 0 to 63
lookup z,[$ff,$01,$01,$01,$01,$01,$01,$01,$01,$01,$09,$09,$0 9,$09,$89,$89,$89,$89,$f9,$01,$01,$01,$01,$01,$01, $01,$01,$01,$01,$ff,$01,$01,$01,$01,$01,$01,$01,$0 1,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01, $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0 1,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
gosub nulti
temp = 189
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$8 0,$90,$90,$9f,$90,$90,$80,$80,$80,$80,$80,$80,$80, $80,$80,$80,$80,$80,$80,$ff,$80,$80,$80,$80,$80,$8 0,$80,$80,$80,$80,$80,$80,$90,$98,$94,$92,$91,$90, $90,$90,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$8 0,$80,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 189
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$80,$80,$80,$80,$80,$80,$90,$90,$9 0,$90,$90,$90,$90,$90,$9f,$80,$80,$80,$80,$80,$80, $80,$80,$80,$80,$ff,$80,$80,$80,$80,$80,$80,$80,$8 0,$80,$80,$81,$81,$81,$81,$81,$81,$81,$81,$81,$81, $81,$81,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$8 0,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
temp = 190
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$f c,$04,$04,$04,$04,$04,$fc,$00,$00,$00,$00,$00,$00, $00,$00,$00,$00,$00,$00,$ff,$00,$00,$00,$00,$00,$0 0,$00,$00,$00,$00,$00,$00,$00,$00,$c0,$40,$c0,$00, $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$00,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 190
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$f8,$88,$88,$88,$88,$00,$00,$f8,$8 8,$88,$88,$88,$98,$00,$00,$f8,$08,$08,$08,$08,$00, $00,$00,$00,$00,$ff,$00,$00,$00,$f8,$88,$88,$08,$0 0,$f8,$00,$00,$f8,$00,$08,$08,$f8,$08,$08,$00,$f8, $88,$88,$08,$00,$f8,$88,$88,$88,$f8,$00,$00,$00,$0 0,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
temp = 191
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$9 f,$90,$90,$90,$90,$90,$9f,$80,$80,$80,$80,$80,$80, $80,$80,$80,$80,$80,$80,$ff,$80,$80,$80,$80,$80,$8 0,$80,$80,$80,$80,$80,$80,$80,$80,$81,$81,$81,$80, $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$8 0,$80,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 191
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$8f,$88,$88,$88,$88,$80,$80,$8c,$8 8,$88,$88,$88,$8f,$80,$80,$8f,$88,$88,$88,$88,$80, $80,$80,$80,$80,$ff,$80,$80,$80,$8f,$88,$88,$88,$8 0,$8f,$82,$84,$8f,$80,$80,$80,$8f,$80,$80,$80,$8f, $88,$88,$88,$80,$8f,$80,$81,$86,$88,$80,$80,$80,$8 0,$ff],temp
gosub podatak
next z

goto kraj



'************************************************* ************
'komande za GLCD *
'************************************************* ************

rst:
reset = 0
pause 1000
reset = 1
temp = $3e
gosub komanda
pause 100
temp = $3f
gosub komanda
pause 100

nulti:
temp = $40'+55
gosub komanda
return

brisanje:
for x = 0 to 7
temp = $b8 + x
gosub komanda
for y = 0 to 63
temp = $00
gosub podatak
next y
next x
pause 1000
return
komanda:
rw = 0
rs = 0
portc = temp
en = 1
pause 5
en = 0
return

podatak:
rw = 0
rs = 1
portc = temp
en = 1
pause 5
en = 0
return

razmak:
temp = $00
return

levo:
cs1 = 0
cs2 = 1
return

desno:
cs1 = 1
cs2 = 0
return
kraj:
pause 1000
goto kraj
end

amindzo
- 12th December 2008, 22:07
i have copied that code to picbsic pro 2.5 but it has some errors in compiling.

skimask
- 13th December 2008, 00:17
i have copied that code to picbsic pro 2.5 but it has some errors in compiling.

Jeeze...WHATEVER you do, don't tell us what the errors you got are. Let us guess at them...no wait...Let's have a lottery, or maybe we can draw pieces of paper out of a hat and guess the errors.

But since you are using PBP 2.50, look in your manual on page 30 at the bottom, then compare those comments with every one of those LOOKUP statements in the code above...
Notice anything?

pash48
- 31st December 2009, 02:39
http://www.parallax.com/Portals/0/Downloads/sw/lcdcc.zip

Acetronics2
- 12th April 2010, 17:56
Maybe is bad ....maybe it help you.
Regards



Hi, Phoenix

Really a nice screen ...

I should learn Serbian language ...



'************************************************* ***************
'* Name : GLCD Test.BAS *
'* Author : Phoenix_1 *
'* Notice : Copyright (c) 2010 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 12/04/2010 *
'* Version : 1.1 *
'* Notes : Easy Pic5 Modified !!! *
'* : *
'************************************************* ***************

@ Device pic16F877a, HS_OSC, BOD_ON, PWRT_OFF, WDT_ON, PROTECT_OFF

Define osc 8

ADCON1 = 7
CMCON = 7

trisB = $00
trisD = $00

en var portB.4
rw var portB.3
rs var portB.2
cs1 var portB.0
cs2 var portB.1
reset var portB.5

rs = 1
rw = 0
en = 0
cs1 = 1
cs2 = 1

temp var byte
x var byte
y var byte
z var byte
h var byte

x = 0
y = 0
z = 0
h = 0

gosub rst
pause 500
gosub brisanje

gosub levo
gosub nulti
temp = 184
gosub komanda
for z = 0 to 63
lookup z,[$ff,$01,$01,$01,$01,$01,$01,$01,$01,$01,$09,$09,$0 9,$09,$09,$09,$89,_
$69,$19,$09,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0 1,$01,$ff,$01,$01,$01,$01,$01,_
$01,$01,$01,$01,$01,$f9,$89,$89,$89,$89,$89,$89,$8 9,$89,$f9,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01, $01,$01,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 184
gosub komanda
for z = 0 to 63
lookup z,[$ff,$01,$01,$01,$01,$01,$01,$01,$01,$01,$f9,$09,$0 9,$09,$09,$09,$09,_
$f9,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$f f,$01,$01,$01,$01,$81,$81,$c1,_
$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$8 1,$e1,$f1,$e1,$81,$01,$01,$01,$01,$01,$01,$01,$01, $01,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
gosub nulti
temp = 185
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$9 0,$88,$86,$81,$80,_
$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$8 0,$80,$ff,$80,$80,$80,$80,$80,_
$80,$80,$80,$80,$80,$9f,$90,$90,$90,$90,$90,$90,$9 0,$90,$9f,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80, $80,$80,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 185
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$80,$80,$80,$80,$80,$80,$91,$91,$9 1,$91,$91,$91,$91,_
$9f,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$f f,$80,$80,$80,$81,$83,$83,$87,_
$81,$81,$81,$81,$81,$81,$80,$80,$80,$80,$80,$80,$8 0,$80,$9f,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80, $80,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
temp = 186
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$c0,$a 0,$90,$88,$84,$fc,_
$80,$00,$00,$00,$00,$00,$00,$00, $00,$00,$00,$00,$00,$00,$ff,$00,$00,$00,$00,$00,_
$00,$00,$00,$00,$00,$7c,$44,$44,$44,$44,$44,$44,$4 4,$c4,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00, $00,$00,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 186
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$fc,$84,$8 4,$84,$84,$84,$84,_
$84,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$f f,$00,$00,$00,$00,$80,$00,$c0,_
$00,$80,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$00,$f0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00, $00,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
temp = 187
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$00,$00,$00,$1f,_
$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 0,$00,$ff,$00,$00,$00,$00,$00,_
$00,$00,$00,$00,$00,$20,$20,$20,$20,$20,$20,$20,$2 0,$3f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00, $00,$00,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 187
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$1f,$10,$1 0,$10,$10,$10,$10,_
$1f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$f f,$00,$00,$00,$00,$0a,$07,$1f,_
$07,$0a,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0 4,$1c,$3f,$1c,$04,$00,$00,$00,$00,$00,$00,$00,$00, $00,$ff],temp
gosub podatak
next z

gosub levo
gosub nulti
temp = 188
gosub komanda
for z = 0 to 63
lookup z,[$ff,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0 1,$21,$31,$f9,$01,_
$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0 1,$01,$ff,$01,$01,$01,$01,$01,_
$01,$01,$01,$01,$01,$01,$01,$79,$09,$09,$09,$09,$8 9,$79,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01, $01,$01,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 188
gosub komanda
for z = 0 to 63
lookup z,[$ff,$01,$01,$01,$01,$01,$01,$01,$01,$01,$09,$09,$0 9,$09,$89,$89,$89,_
$89,$f9,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$f f,$01,$01,$01,$01,$01,$01,$01,_
$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0 1,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01, $01,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
gosub nulti
temp = 189
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$8 0,$90,$90,$9f,$90,_
$90,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$8 0,$80,$ff,$80,$80,$80,$80,$80,_
$80,$80,$80,$80,$80,$80,$80,$90,$98,$94,$92,$91,$9 0,$90,$90,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80, $80,$80,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 189
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$80,$80,$80,$80,$80,$80,$90,$90,$9 0,$90,$90,$90,$90,_
$90,$9f,$80,$80,$80,$80,$80,$80, $80,$80,$80,$80,$ff,$80,$80,$80,$80,$80,$80,$80,_
$80,$80,$80,$81,$81,$81,$81,$81,$81,$81,$81,$81,$8 1, $81,$81,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$8 0,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
temp = 190
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$f c,$04,$04,$04,$04,_
$04,$fc,$00,$00,$00,$00,$00,$00, $00,$00,$00,$00,$00,$00,$ff,$00,$00,$00,$00,$00,_
$00,$00,$00,$00,$00,$00,$00,$00,$00,$c0,$40,$c0,$0 0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00, $00,$00,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 190
gosub komanda
for z = 0 to 63
lookup z,[$ff,$00,$00,$00,$f8,$88,$88,$88,$88,$00,$00,$f8,$8 8,$88,$88,$88,$98,_
$00,$00,$f8,$08,$08,$08,$08,$00,$00,$00,$00,$00,$f f,$00,$00,$00,$f8,$88,$88,$08,_
$00,$f8,$00,$00,$f8,$00,$08,$08,$f8,$08,$08,$00,$f 8,$88,$88,$08,$00,$f8,$88,$88,$88,$f8,$00,$00,$00, $00,$ff],temp
gosub podatak
next z

temp = 0
gosub levo
gosub komanda
temp = 191
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$9 f,$90,$90,$90,$90,_
$90,$9f,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$8 0,$80,$ff,$80,$80,$80,$80,$80,_
$80,$80,$80,$80,$80,$80,$80,$80,$80,$81,$81,$81,$8 0,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80, $80,$80,$ff],temp
gosub podatak
next z

temp = 0
gosub desno
gosub komanda
temp = 191
gosub komanda
for z = 0 to 63
lookup z,[$ff,$80,$80,$80,$8f,$88,$88,$88,$88,$80,$80,$8c,$8 8,$88,$88,$88,$8f,_
$80,$80,$8f,$88,$88,$88,$88,$80, $80,$80,$80,$80,$ff,$80,$80,$80,$8f,$88,$88,$88,_
$80,$8f,$82,$84,$8f,$80,$80,$80,$8f,$80,$80,$80,$8 f,$88,$88,$88,$80,$8f,$80,$81,$86,$88,$80,$80,$80, $80,$ff],temp
gosub podatak
next z

goto kraj



'************************************************* ************
'komande za GLCD *
'************************************************* ************

rst:
reset = 0
pause 1000
reset = 1
temp = $3e
gosub komanda
pause 100
temp = $3f
gosub komanda
pause 100

nulti:
temp = $40'+55
gosub komanda
return

brisanje:
for x = 0 to 7
temp = $b8 + x
gosub komanda

for y = 0 to 63
temp = $00
gosub podatak
next y

next x
pause 1000
return

komanda:
rw = 0
rs = 0
portD = temp
en = 1
pause 1 '5
en = 0
return

podatak:
rw = 0
rs = 1
portD = temp
en = 1
pause 1 '5
en = 0
return

razmak:
temp = $00
return

levo:
cs1 = 0
cs2 = 1
return

desno:
cs1 = 1
cs2 = 0
return

kraj:
pause 1000
goto kraj

end


Congratulations, Robert

I just sped it a bit, as datasheet enable cycle time is specified @ 1 ms ...

Alain

phoenix_1
- 12th April 2010, 19:38
Hi Alain,
It was only test for some my project .....
Yes it was slow but work and it was in my start to play with graphic display with touch screen from Mikro Elektronika.....
It cost 20EUR but there is much faster GLCD in market...

The best regards
/Robert

flotulopex
- 10th August 2010, 22:04
Hello,

May I ask some of you what designing software* you use to create the graphics?

I'm starting using a EADOGL128-6 display (http://www.lcd-module.com/products/dog.html). At the bottom of this website, there's a soft I may use.

Nevertheless, is there a program most people use?

*I'm using Windows XP

SKOLS1
- 29th January 2011, 15:09
Can you post a tutorial or something like that,so I can made my own picture on GLCD?And how to put a text line,from mesurments with DS18B20?

ScaleRobotics
- 29th January 2011, 15:56
Can you post a tutorial or something like that,so I can made my own picture on GLCD?And how to put a text line,from mesurments with DS18B20?

If you just mean graphics, and not picture, here is one http://www.picbasic.co.uk/forum/content.php?r=174-Using-Nokia-3310-LCD

And a thermostat using the 3310 and a DS18B20 http://www.picbasic.co.uk/forum/showthread.php?t=327&p=87933#post87933

If you really need a picture then you could get one of these: http://www.picbasic.co.uk/forum/content.php?r=239-3.5-Color-LCD-code-example

Acetronics2
- 29th January 2011, 16:08
Hi,

Mikroelektronika offers it's GLCG Bitmap editor in their Free version compilers ...

nice tool to convert Bitmaps to " printable " files ...

You just have to write the " driver " to print the 8192 generated pixels ... or exactly ... the 1024 bars !

here's such file :



// ------------------------------------------------------
// GLCD Picture name: truck.bmp
// GLCD Model: KS0108 128x64
// ------------------------------------------------------
unsigned char const truck_bmp[1024] = {
0, 0, 0, 0, 0,248, 8, 8, 8, 8, 8, 8, 12, 12, 12, 12,
12, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9,137,137,137,137,137,137,
137,137,137,137,137,137,137, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 13,253, 13,195, 6,252, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
240,240,240,240,240,224,224,240,240,240,240,240,22 4,192,192,224,
240,240,240,240,240,224,192, 0, 0, 0,255,255,255,255,255,195,
195,195,195,195,195,195, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,255,240, 79,224,255, 96, 96, 96, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 64, 64, 64, 64,128, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
255,255,255,255,255, 0, 0, 0, 0,255,255,255,255,255, 0, 0,
0, 0,255,255,255,255,255, 0, 0, 0,255,255,255,255,255,129,
129,129,129,129,129,129,128, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,255, 1,248, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 16,224, 24, 36,196, 70,130,130,133,217,102,112,
160,192, 96, 96, 32, 32,160,160,224,224,192, 64, 64,128,128,192,
64,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 63, 96, 96, 96,224, 96, 96, 96, 96, 96, 96,
99, 99, 99, 99, 99, 96, 96, 96, 96, 99, 99, 99, 99, 99, 96, 96,
96, 96, 99, 99, 99, 99, 99, 96, 96, 96, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 96, 96, 96, 96, 96, 96, 96, 64, 64,
64,224,224,255,246, 1, 14, 6, 6, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2,130, 67,114, 62, 35, 16, 16, 0, 7, 3, 3, 2,
4, 4, 4, 4, 4, 4, 4, 28, 16, 16, 16, 17, 17, 9, 9, 41,
112, 32, 67, 5,240,126,174,128, 56, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
1, 1,127,127,127,127,255,255,247,251,123,191, 95, 93,125,189,
189, 63, 93, 89,177,115,243,229,207, 27, 63,119,255,207,191,255,
255,255,255,255,255,255,255,127,127,127,127,127,12 7,127,127,255,
255,255,127,127,125,120,120,120,120,120,248,120,12 0,120,120,120,
120,248,248,232,143, 0, 0, 0, 0, 0, 0, 0, 0,128,240,248,
120,188,220, 92,252, 28, 28, 60, 92, 92, 60,120,248,248, 96,192,
143,168,216,136, 49, 68, 72, 50,160, 96, 0, 0, 0, 0, 0, 0,
0, 0, 0,128,192,248,248,248,248,252,254,254,254,254,254, 254,
254,254,254,254,254,255,255,255,255,255,246,239,20 8,246,174,173,
169,128,209,208,224,247,249,255,255,252,220,240,12 7,255,223,255,
255,255,255,255,255,254,254,255,255,255,255,255,25 5,255,254,255,
255,255,255,255,255,255,254,254,254,254,254,254,25 4,254,254,254,
254,254,254,254,255,255,255,255,255,255,254,255,19 0,255,255,253,
240,239,221,223,254,168,136,170,196,208,228,230,24 8,127,126,156,
223,226,242,242,242,242,242,177, 32, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 3, 3, 3, 7, 7, 7, 7, 7, 15,
15, 15, 7, 15, 15, 15, 7, 7, 15, 14, 15, 13, 15, 47, 43, 43,
43, 43, 43, 47,111,239,255,253,253,255,254,255,255,255,255,255 ,
191,191,239,239,239,191,255,191,255,255,255,255,25 5,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,25 5,255,255,255,
255,255,255,255,127,127,127,127,255,255,191,191,19 1,191,255,254,
255,253,255,255,255,251,255,255,255,127,125, 63, 31, 31, 31, 31,
31, 31, 63, 15, 15, 7, 7, 3, 3, 3, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0,
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 3, 3, 3, 11, 11, 11, 11, 7, 3, 14, 6, 6,
6, 2, 18, 19, 19, 3, 23, 21, 21, 17, 1, 19, 19, 3, 6, 6,
14, 15, 15, 7, 15, 15, 15, 11, 2, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};


Alain

SKOLS1
- 29th January 2011, 18:42
If you just mean graphics, and not picture, here is one http://www.picbasic.co.uk/forum/content.php?r=174-Using-Nokia-3310-LCD

And a thermostat using the 3310 and a DS18B20 http://www.picbasic.co.uk/forum/showthread.php?t=327&p=87933#post87933

If you really need a picture then you could get one of these: http://www.picbasic.co.uk/forum/content.php?r=239-3.5-Color-LCD-code-example
It's ok,thanks for the examples.But I want to use GLCD from Easy PIC6 and to put a text line.

ScaleRobotics
- 30th January 2011, 23:24
It's ok,thanks for the examples.But I want to use GLCD from Easy PIC6 and to put a text line.

Here is the data sheet for the WDG0151 GLCD on the EasyPic6 board.

Acetronics2
- 6th February 2011, 11:02
Another GLCD Assistant :

http://en.radzio.dxp.pl/bitmap_converter/

Alain

pedja089
- 6th February 2011, 13:43
phoenix_1,
You should write where you took that code.
The comments are in Serbian. And that program was written by one of my students shortened the course of programming in the PBP. Which took place several years ago in the forum, and is still active.
The award for this task was a small development system, which I did.
You have complete documentation for the display on link.
http://www.elektronika.ba/forum/viewtopic.php?f=3&t=6862&p=71955

tomyhony
- 25th November 2012, 11:45
hello
can one show me small program as example using ks0108 lcd desplay word and how can i interfacing it