??? 05/27/05 16:57 Read: times |
#94012 - LPC932 Timer Variable |
Hi, I am using timer1 of the lpc932 to count for about 22 sec. It works fine the first time I call the fuction to make it run. But the second time it is called, one of the variables does no reach its maximum. For intance if (++ticks10 == 250) does not reache 250, but 249 and goes back to zero. What could be wrong?
here is the isr for the timer1 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; } |
Topic | Author | Date |
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 |