View previous topic :: View next topic |
Author |
Message |
Anderl
Joined: 06 Sep 2010 Posts: 6
|
Posted: Sun Feb 17, 2013 2:08 am Post subject: KS0108 Display: Trouble with higher clock speed |
|
|
Hi Guys
Another curious problem with a 128x64 KS0180 display and a Mega8:
As long as i use the internal oscillator or a crystal with up to 8Mhz everything is fine.
If i change to a 16Mhz crystal, i just get s*** on my display. Pictures are shifted and letters
jump over 3 lines within seconds and show egyptian hieroglyphs.
I think it is a timing problem of the display caused by the high crystal speed.
Currently i use the "glcdKS108.lbx" library file and i think it cannot handle 16Mhz.
Has anybody got an idea how to change the library to make it work?
Or maybe there is a new library.
Thanks for your help in advance.
Anderl
(BASCOM-AVR version : 2.0.7.4 , Latest : 2.0.7.6 ) |
|
Back to top |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
Posted: Sun Feb 17, 2013 1:40 pm Post subject: |
|
|
Are you sure that's not an hardware problem? For example, 4mhz databus will work on a breadboard, but 16mhz give much problems.
I read somewhere (can't find the topic anymore) that you can double the @genus values in the library for fast crystals.
Backup you file first. _________________ www.evertdekker.com Bascom code vault |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat Mar 02, 2013 10:45 pm Post subject: |
|
|
the genus() is independent of the hardware speed.
So genus(2) will create the same delay for each $crystal value.
But : make sure the speed you specify is the actual speed !
Do the famous speed/blink test to learn if the $crystal value matches the actual speed. _________________ Mark |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 320 Location: Japan
|
|
Back to top |
|
|
caargoo
Joined: 08 Jan 2009 Posts: 4
|
Posted: Sun Mar 03, 2013 7:27 pm Post subject: |
|
|
This code works fine with 18MHz and also with 20MHz
Code: |
'Test mit Pollin Display LCD-Modul TG12864B-13
$regfile = "m168def.dat"
$crystal = 18432000
$hwstack = 64
$swstack = 32
$framesize = 24
$lib "glcdKS108.lib"
Config Graphlcd = 128 * 64sed , Dataport = Portd , Controlport = Portb , Ce = 2 , Ce2 = 3 , Cd = 0 , Rd = 1 , Reset = 5 , Enable = 4
Cls
Setfont Font8x8
Do
Showpic 0 , 0 , Bild1
Wait 4
Cls
Line(0 , 30) -(127 , 30) , 1
Line(0 , 31) -(127 , 31) , 1
Line(0 , 32) -(127 , 32) , 1
Line(0 , 0) -(127 , 63) , 1
Line(0 , 63) -(127 , 0) , 1
Circle(63 , 31) , 30 , 1
Wait 3
Cls
Loop
End
'Zeichensatzdatei:
$include "font8x8.font"
Bild1:
$bgf "Star.bgf"
|
|
|
Back to top |
|
|
andro
Joined: 12 Mar 2007 Posts: 94 Location: Ljubljana
|
Posted: Mon Mar 04, 2013 3:01 pm Post subject: |
|
|
Hi!
I had similar problems with DEM displays. On the other hand - no problems with Winstar display (of corse both with same controller).
I solved the problem by adding some simple delay on several stages in original KS library. But, this is long ago...
So, what is the brand of Your display?
BR
Andrej |
|
Back to top |
|
|
Wilfred
Joined: 15 Jul 2010 Posts: 40
|
Posted: Tue Dec 03, 2013 3:44 pm Post subject: |
|
|
good afternoon gentleman,
To help out Andrl
I had the same problem www.Ledsee.com 128x64 cheap display with ks0108
tried and failed one whole day until I hooked up the scope to DB0 and saw "analog" binary on the port (a PCB is used, lenght of lines to LCD less than 5cm)
most of the time the binary signal was not on the logical levels.
I have a 16MHz X-tal on my ATMEGA 32A ...when I set the $crystal command at 64 MHz everything works (everything should then work at 4MHz)
and indeed it does
but not at 16MHz
I think I will solder an 4 or 8 MHz xtal in the board.
or is there a smart way to add a delay to the ks0108 driver?
Wilfred PE1NDO |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Tue Dec 03, 2013 11:38 pm Post subject: |
|
|
You can try the attached lib. It checks status before read/write. _________________ Mark |
|
Back to top |
|
|
Wilfred
Joined: 15 Jul 2010 Posts: 40
|
Posted: Thu Dec 05, 2013 1:05 pm Post subject: |
|
|
Hi Mark
TNX a bunch!
it work like a charm
Wilfred |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Dec 06, 2013 11:40 am Post subject: |
|
|
thanks for letting me know. you can thank O-Family, i was inspired by his mod
I changed it in the official lib as well. _________________ Mark |
|
Back to top |
|
|
Wilfred
Joined: 15 Jul 2010 Posts: 40
|
Posted: Mon Dec 09, 2013 8:14 am Post subject: |
|
|
Hi Mark,
I made a little mistake. It works with O-family's .lbx file not with the 0108-v2
O-Family's driver sometimes needs a few pushes on the reset button but if it works it stayes working
the V2 file only shows the left half of the screen.
and I think that is what is in the buffer of the lcd
because the screen is frozen
Wilfred |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Mon Dec 09, 2013 10:45 am Post subject: |
|
|
thanks for the feedback. attached an update. this one is almost identical to the working one. notice that i changed the name to the official name. _________________ Mark |
|
Back to top |
|
|
Wilfred
Joined: 15 Jul 2010 Posts: 40
|
Posted: Tue Dec 10, 2013 7:40 am Post subject: |
|
|
Mark,
You won't believe this,
now the left side of the display is blank.
it's the same as in the picures I send, but now on the other side of the display
W. |
|
Back to top |
|
|
six1
Joined: 27 Feb 2009 Posts: 553
|
Posted: Tue Dec 10, 2013 8:23 am Post subject: |
|
|
Programers daily trouble _________________ For technical reasons, the signature is on the back of this message. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Tue Dec 10, 2013 10:44 am Post subject: |
|
|
it is amazing.
there are only 2 differences.
the working lib has :
_gwrite_cmd:
Rcall _gRead_Status
* Cbi _glcd_portm , _glcd_cd
Rjmp _Gwrite_DataMisc
_gwrite_data:
Rcall _gRead_Status
* Sbi _glcd_portm , _glcd_cd
_gwrite_datamisc:
while my version :
_gwrite_cmd:
* Cbi _glcd_portm , _glcd_cd
Rjmp _Gwrite_DataMisc
_gwrite_data:
* Sbi _glcd_portm , _glcd_cd
_gwrite_datamisc:
rcall _gRead_Status
as you can see there, the difference between command and data is set with the CD pin. And status is read after this pin has been set. hmm. that might be the source of the problem : maybe the chip does not like the pin to be changed which makes sense when it is not ready.
i attached an update. _________________ Mark |
|
Back to top |
|
|
|