
while(1)
{
     while(P0^7==1);
     TR1=1;
     while(P0^7==0);
     TR1=0;
     
     //Timer0 is properly configured as 50ms timer
     //there is also a variable counter which gets
     //incremented upon timer0 overflow
     
     display_lcd(...);
     
     //for resetting screen
     while(P0^7==1);
     while(P0^7==0);
     
     clear_lcd();
     init_counter();
}