Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/27/05 20:34
Read: times


 
#94024 - No, that's not the same code!
Responding to: ???'s previous message
Originally, Juan Carlos said:
void buzzer_timer(void) interrupt 3
{
T1_Start(); // start timer again

if (++ticks10 == 250)
{
if (LCD_Flag == 0) // lcd off
{
if (P2 &= 0x0C) // LCD on
_nop_();
else
P2 |= 0x0C;

if (++ticks == 40){
P2 &= ~0x0C;
ticks = 0;
SCON &= 0x50;
LCD_Flag = 1;
TR1 = 0;
}
}
ticks10 = 0;
}
return;
}

Then, with formatting, Juan Carlos said:
void buzzer_timer(void) interrupt 3 
{
    T1_Start();  // start timer again

    	if (++ticks10 == 250)
	{ 
	    if (++ticks == 40){
	    P2 &= ~0x0C;
	    ticks = 0;
	    SCON &= 0x50;
	    LCD_Flag = 1;
	    TR1 = 0;
			}
	  ticks10 = 0;
	  }
	return;
}

Clearly not the same function!

However, I do now see that you have separate 'ticks' and 'ticks10' variables - so my original comment about the increments was wrong.
http://www.8052.com/forum/read.phtml?id=94015



List of 11 messages in thread
TopicAuthorDate
LPC932 Timer Variable            01/01/70 00:00      
   Call?!            01/01/70 00:00      
      Of Course Not!            01/01/70 00:00      
         Initialisation?            01/01/70 00:00      
            Here it is Andy!            01/01/70 00:00      
               2 things            01/01/70 00:00      
                  You're the Teacher here            01/01/70 00:00      
                     replies            01/01/70 00:00      
               No, that's not the same code!            01/01/70 00:00      
   Suspicious pre-increments            01/01/70 00:00      
      Sorry - my mistake            01/01/70 00:00      

Back to Subject List