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 17:53
Modified:
  05/27/05 17:55

Read: times


 
#94020 - 2 things
Responding to: ???'s previous message
[edit] you can not edit the title, this is more than 2 things[end edit]

1) you call T1_Start() from two levels - all kinds of trouble can result.
2) how do you plan to hold 34816 in 8 bits?
TH1 = (34816);
TL1 = (34816);

3) cleaner
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;
}

4) Why do you have a return, illegal in an ISR??
5) Why do you make it 2 levels, why not count to 1000 in an int??
6) You may very well never get to both true, VISUALIZE ticks10 goes to 250 without ticks going to 40 and ticks10 get reset -OOPS

Erik

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