CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

GLCD flickering

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
waleed.ahafeez



Joined: 16 Mar 2012
Posts: 10

View user's profile Send private message

GLCD flickering
PostPosted: Fri Mar 16, 2012 5:51 am     Reply with quote

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: 9241
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Mar 16, 2012 5:57 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 16, 2012 6:07 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 16, 2012 7:41 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 16, 2012 9:26 am     Reply with quote

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. Sad
waleed.ahafeez



Joined: 16 Mar 2012
Posts: 10

View user's profile Send private message

PostPosted: Sat Mar 17, 2012 1:47 am     Reply with quote

Finally I solve the problem thnx John and temtronic... Smile
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Sat Mar 17, 2012 10:16 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Mar 21, 2012 12:46 am     Reply with quote

Hi,
I fixed the mentioned problem by using
Code:

glcd_text57(x,y,*txtptr,1,OFF);

instead of the above mentioned function delete_char.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group