KS0108 gLCD working slowly

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
planeri
Posts: 11
Joined: Wed Aug 01, 2018 6:20 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

KS0108 gLCD working slowly

Post by planeri »

Hi! I'm trying to use a monochrome 128 x 64 gLCD (Winstar WG12864A) with the KS0108 component and a PIC18F4620 with 20 MHz osc. In simulation it works perfect but in hardware or Proteus it refreshes abnormally slow. With the Bitmap Drawer ROM component the images appears slowly, shifting from bottom to top (like there's some kind of programmed delay after printing each row), even with the Print macro the letters appear slowly. I tried with the HS-PLL 4xFosc configuration and transparency, it helps but it's not enough.

I worked with XC8 Microchip libraries in the past and I know for sure that a PIC18F4620 with 20 MHz osc should be more than enough to drive this kind of displays with instant response. Maybe I'm forgetting some configuration in the component, any suggestions?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: KS0108 gLCD working slowly

Post by Benj »

Hello,

Can you post your Flowcode project file and we can investigate for you.

It's worth checking your config and clock speed are setup correctly so the best way to do this is to do the 1 second flash test.
https://www.matrixtsl.com/wiki/index.ph ... ED_flasher

planeri
Posts: 11
Joined: Wed Aug 01, 2018 6:20 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: KS0108 gLCD working slowly

Post by planeri »

Hi, Ben!

I'm pretty sure that the clock configuration is fine. I attached the following files to help you look at my program:

- gLCD Test.rar: It includes all the Flowcode project files, a folder with images and a Proteus simulation project. The program displays a welcome screen, then displays a second screen with multiple options sent as strings with the print macro and finally displays a counter with a variable that increments its value each second using TMR1 interrupt. The program also uses PD7 to generate a 1 Hz / 100 us pulse.

- GLCD_TEST.asm and GLCD_TEST.hex: This is basically the same program made in another environment and compiled with MPASM 5.35. Unfortunately this environment doesn't use XC8 libraries, so I can't make a direct comparison between source codes. :cry:

I tried both hex files in hardware and using the Proteus simulation, they work identically except for the refresh speed of the gLCD. The hex file compiled by flowcode refreshes the gLCD slowly with this shifting effect, while the second hex file refreshes the display instantly. In both cases the counter works as intended, so I believe the problem is not related to clock configuration.

Thanks for your help!
Attachments
GLCD_TEST.HEX
(16.41 KiB) Downloaded 172 times
GLCD_TEST.asm
(77.71 KiB) Downloaded 184 times
gLCD Test.rar
(282.97 KiB) Downloaded 181 times

keejay
Flowcode v5 User
Posts: 115
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 15 times
Contact:

Re: KS0108 gLCD working slowly

Post by keejay »

Was there ever a solution to this slow operation of the gLCD screen? I'm busy with a project using a gLCD (KS0108) and am having the same problem. Everything works fine, except the screen updates very slowly.

User avatar
AbhijitR
Posts: 299
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 280 times
Been thanked: 79 times
Contact:

Re: KS0108 gLCD working slowly

Post by AbhijitR »

Hello!

Even I faced more or less same problem, but with gLCD_SSD1306_i2c1 display (I used the tiny OLED display 128x64 one), somehow increasing the oscillations (I used PLL) to speed up from 16MHz physical oscillator to 64MHz (PLL 16x4=64), the display then refreshed better.

Thank you.

keejay
Flowcode v5 User
Posts: 115
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 15 times
Contact:

Re: KS0108 gLCD working slowly

Post by keejay »

OK thanks for your reply. I changed the 20MHz crystal to a 64MHz crystal and the screen's response is much better now. But now the GPS module thats feeding data in at 9600 baud doesnt work. I've checked the Mirochip data sheet and it's possible to achieve 9600 (well 9615 baud) with a 64MHz crystal. Is this 0.16% baud error too big or is there possibly a FC8 bug when generating a 9600 baud from a 64MHz cystal?

Thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: KS0108 gLCD working slowly

Post by Benj »

Hi Keejay,

The baud should be calculated correctly but I am open to the fact there could be a bug.

Before I dig in and investigate please can you confirm your settings at 64MHz with a 1 second flasher just as a quick sanity check.

https://www.matrixtsl.com/wiki/index.ph ... ED_flasher

keejay
Flowcode v5 User
Posts: 115
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 15 times
Contact:

Re: KS0108 gLCD working slowly

Post by keejay »

Hi Ben,

Thanks for the reply. I've managed to get the whole project working, but I'm not sure I quite understand what I've done :? Initially I had a 20MHz crystal and everything (BME280, GPS, KS0108 gLCD display, 4 x K-Type thermocouples and a quad encoder) all worked 100% - just that the gLCD was very slow (hence me posting under this topic). As advised above, I then changed the crystal to a 64MHz crystal and updated the the project options to the correct crystal speed. The gLCD worked MUCH better and everything else also worked perfectly, except the GPS (that outputs its data at 9600 baud). All I could think was that with a 64MHz crystal, the serial input wasn't configuring correctly for receiving at 9600 baud. I then replaced the 64MHz crystal with a 16MHz crystal and left the project option crystal speed at 64MHZ and made sure that the 4 x PLL config bit was enabled (4 x PLL bit was enabled the entire time - maybe this is why the GPS didnt work with a 64MHz crystal-not sure??) in the config settings and now everything works 100%. The gLCD screen is a little slower but acceptable.

Post Reply