T6963C drawing hidden panel distort display on active panel

General discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
glenn13
Posts: 48
Joined: 18 Nov 2011 01:10
Location: Philippines

T6963C drawing hidden panel distort display on active panel

#1 Post by glenn13 » 03 May 2012 04:37

Hi,

I was working with T6963C GLCD. I want to switch display from active screen to another screen.
I draw the next screen on graphic panel 1 and the active display is on graphic panel 0 to avoid flickering during switch.

My problem is that the active screen display become distorted during drawing of next screen on hidden grahic panel 1.
But then after finish drawing, switching of graphic panel is no problem, I just dont want the active screen to be distorted during drawing
of next screen before displaying.

Is my coding have a mistake on this? Is there a way to avoid this occurrence?
Thanks for the help.

MY CODE:
if (sw5==0){
T6963C_setGrPanel(0);
T6963C_Set_Font_Adv(label4.fontname,T6963C_BLACK, _T6963C_HORIZONTAL);
T6963C_Write_Text_Adv(InsrtModel2,label4.left+55,label4.top);
T6963C_Set_Font_Adv(label4.fontname,T6963C_WHITE, _T6963C_HORIZONTAL);
T6963C_Write_Text_Adv(InsrtModel1,label4.left+55,label4.top);
T6963C_displayGrPanel(0);
model=1;
T6963C_setGrPanel(1);
delay_us(10);
DrawScreen(&Modescreen);
delay_us(10);
}
if (sw4==0) {
T6963C_setGrPanel(0);
T6963C_Set_Font_Adv(label4.fontname,T6963C_BLACK, _T6963C_HORIZONTAL);
T6963C_Write_Text_Adv(InsrtModel1,label4.left+55,label4.top);
T6963C_Set_Font_Adv(label4.fontname,T6963C_WHITE, _T6963C_HORIZONTAL);
T6963C_Write_Text_Adv(InsrtModel2,label4.left+55,label4.top);
T6963C_displayGrPanel(0);
model=2;
T6963C_setGrPanel(1);
delay_us(10);
DrawScreen(&Modescreen);
delay_us(10);

}
if (sw0==0){
if (model!=0){
T6963C_displayGrPanel(1);
num=2;
}

Best Regards,

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: T6963C drawing hidden panel distort display on active pa

#2 Post by zristic » 03 May 2012 08:14

Well, this is a correct procedure:

1. Show panel #0.
2. Call T6963C_SetGrPanel(1) to set panel #1 as active drawing surface, but not display surface,
3. Draw objects on panel #1,
4. Show panel #1 by calling T6963C_DisplayGrPanel(1);

This will solve the issue.

glenn13
Posts: 48
Joined: 18 Nov 2011 01:10
Location: Philippines

Re: T6963C drawing hidden panel distort display on active pa

#3 Post by glenn13 » 03 May 2012 08:56

Hi zristic,

Thanks for the reply.

Your given procedure was almost the same as mine, the only difference is the time of display of panel 1.
Mine was waiting the button to be pushed before it switch panel from 0 to 1.

My Flow:
1. Set panel 0
2. Draw screen
3. Display panel 0
4. if Button A is pushed, write label on panel 0, set panel 1, draw screen.
5. if Button B is pushed, display panel 1.

But the problem is, after procedure 4, the display was cleared at about 16 pixels from the top.

Any idea?

Thanks again.

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: T6963C drawing hidden panel distort display on active pa

#4 Post by zristic » 03 May 2012 09:16

Yes, this happens when you exceed the RAM boundary of one screen.
I need to check the entire code, if you feel like that you can send me the project to zristic att mikroe.com and i will check it on hw.

glenn13
Posts: 48
Joined: 18 Nov 2011 01:10
Location: Philippines

Re: T6963C drawing hidden panel distort display on active pa

#5 Post by glenn13 » 03 May 2012 12:37

Hi,

It is really difficult for me to send my project codes outside company premises. I dont have permission to export files.
The project contains terms that are confidential.

But maybe I could make codes that depicts exactly the same problem.
I will test it first then I will send to you for verification.

Thank you for the time and help. It cheers me up. :wink:

Best regards,

Post Reply

Return to “mikroC PRO for dsPIC30/33 and PIC24 General”