View previous topic :: View next topic |
Author |
Message |
waleed.ahafeez
Joined: 16 Mar 2012 Posts: 10
|
GLCD flickering |
Posted: Fri Mar 16, 2012 5:51 am |
|
|
Dear All,
I have written the firmware for the Thermal Mass Industrial Flow Meter on PIC18F452 for my organization. I used the built in CCS Compiler's RTOS, but the problem is whenever the data changed the main screen of glcd flickers as I have to remove the previous data for displaying the latest one. I tried to use the glcd_update option but due to limited memory of micro controller it is not possible. Kindly help in this problem otherwise my boss will kill me..:(
Thanks in advance
Regards,
Waleed |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Fri Mar 16, 2012 5:57 am |
|
|
sorry to hear about your up coming funeral......
really, you have several options or cures...
1) replace the PIC with one that has more memory and speed
2) replace the GLCD with a better one
3) recode the 'update' section of the GLCD driver
4) recode the program, replacing the RTOS with your own code
5) without having your hardware and code in front of me, I can't help beyond that since I don't know or see what is really happening...
..heck it could even be a power supply problem,
but my crystalball is kinda fuzzy ! |
|
|
waleed.ahafeez
Joined: 16 Mar 2012 Posts: 10
|
|
Posted: Fri Mar 16, 2012 6:07 am |
|
|
I have tried replacing the rtos code with the simpler sequential code but for displaying the new data I have to remove the previous data and for removing previous data I am using command
Code: |
void delete_char(int x ,int y)
{
glcd_rect(x,y,x+8,y+8,YES,OFF);
}
|
and for displaying data I am using
Code: |
void show_text(int x, int y, char* text)
{
glcd_text57 (x,y,text,1,ON);
}
|
Is there any other way to display the new data which replaces the previous data without flickering ? |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Fri Mar 16, 2012 7:41 am |
|
|
Hi,
Most versions of the glcd_text routine will only turn on the required pixels to create a character. IOW, the routine expects a blank canvas to write on. If you need to continuously update some text, you'll need to clear the old text first, but this method will frequently cause flicker. A much better solution is to modify the glad_text routine so that it explicitly turns on and off ALL the pixels used to create the character. I can't post the fix right now because I'm traveling, but it' easy to do yourself with a few lines of code. It's also been posted before if you do a bit of looking.
John |
|
|
waleed.ahafeez
Joined: 16 Mar 2012 Posts: 10
|
|
Posted: Fri Mar 16, 2012 9:26 am |
|
|
Dear John,
Would you please send me the fixed glcd_text routine's code on the forum,as I am new to CCS compiler, and I mentioned earlier that I am in so much trouble due to this flickering issue. |
|
|
waleed.ahafeez
Joined: 16 Mar 2012 Posts: 10
|
|
Posted: Sat Mar 17, 2012 1:47 am |
|
|
Finally I solve the problem thnx John and temtronic... |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Sat Mar 17, 2012 10:16 am |
|
|
Hi,
You should post the fix as it might be helpful to other users now and in the future!
John |
|
|
waleed.ahafeez
Joined: 16 Mar 2012 Posts: 10
|
|
Posted: Wed Mar 21, 2012 12:46 am |
|
|
Hi,
I fixed the mentioned problem by using
Code: |
glcd_text57(x,y,*txtptr,1,OFF);
|
instead of the above mentioned function delete_char. |
|
|
|