Page 1 of 1
GCLD print speed
Posted: Wed Aug 15, 2012 1:30 pm
by Tony Brown
I have got my GLCD to work in flowcode, but when it comes to printing anything on the screen it prints a letter at a time instead of all text instantly.
Anyone have any idea's
Thanks
Re: GCLD print speed
Posted: Wed Aug 15, 2012 4:51 pm
by Benj
Sounds like your micro is running pretty slowly or may be running at the incorrect speed.
What is your clock speed and have you confirmed the Flowcode clock speed in the project options matches the hardware clock speed by running a simple 1 second flasher test.
Also which gLCD are you using?
Re: GCLD print speed
Posted: Wed Aug 15, 2012 5:49 pm
by Tony Brown
Hi Benj
The GLCD i am using is a "MG1206E 128x64 dot glcd".
I am using a 4MHz xtal and flowcode reflex this, the only thing I found wrong was the setting were on HS instead of XT, which I have now changed but this has changed nothing.
Tony
Re: GCLD print speed
Posted: Wed Aug 15, 2012 7:43 pm
by Enamul
Hi,
Can you please post the screen shot of your config?
Enamul
Re: GCLD print speed
Posted: Wed Aug 15, 2012 8:53 pm
by Tony Brown
Hi Enamul
Please find attached the requested screen shot.
Thanks for your help
Tony
Re: GCLD print speed
Posted: Wed Aug 15, 2012 9:41 pm
by Enamul
Hi Tony,
Your config seems fine. It might be a code issue in that case. Can you kindly post your FC with custom c code so that we can dig out where it going wrong?
Enamul
Re: GCLD print speed
Posted: Wed Aug 15, 2012 10:45 pm
by Tony Brown
Hi Enamul
Glad to here my config is correct, thought it would be but nice to have a second opinion
Please find attached the requested FC custom file.
Thanks
Tony
Re: GCLD print speed
Posted: Thu Aug 16, 2012 10:34 am
by Benj
Hi Tony,
Could the 4MHz crystal be the cause of the problems. Could you switch this for say a 20MHz crystal and get a 5 fold speed increase?
Another alternative which will give you more speed would be to edit this function in the custom C file.
Code: Select all
void MX_LCD_Enable (void)
{
set_bit(MX_CONTROL_PORT, MX_ENABLE);
//delay_10us(1); //Min delay 450ns
nop();
nop();
nop();
nop();
nop();
clear_bit(MX_CONTROL_PORT, MX_ENABLE);
//delay_10us(1); //Min delay 1.5us
nop();
nop();
nop();
nop();
nop();
}
Simply removing some of the nop(); instructions will allow the program to throw data across to the display faster. I would first investigate upping the crystal value and then once this is working you can try playing around with the number of nop instructions to try and get even more speed.
Re: GCLD print speed
Posted: Thu Aug 16, 2012 11:13 am
by Enamul
Hi Tony,
I have just got option to see the c code and my opinion is same as Ben. If I were you I would try with delays in Enable macro as this is controlling write speed..
Enamul
Re: GCLD print speed
Posted: Thu Aug 16, 2012 11:20 am
by Tony Brown
Thanks guys, just one more question, do I remove a nop() from both set bit and clear bit?
Thanks Tony
Re: GCLD print speed
Posted: Thu Aug 16, 2012 11:29 am
by Benj
Hi Tony,
I don't think they have to be absolutely identical so you can probably remove from either side without too many ill effects. Best bet is to have a play and see what works.
The thing that will give you the most significant speed increase will be upgrading the crystal so be careful about removing all the nops and then trying with a faster crystal as this probably will require some if not all of the nops to be in place to allow the comms to work.
Re: GCLD print speed
Posted: Thu Aug 16, 2012 11:44 am
by Tony Brown
Thank for advice, will be trying the 20MHz xtal first, hopefully this will solve my problem.
Thanks