??? 05/27/05 17:36 Read: times |
#94019 - Here it is Andy! Responding to: ???'s previous message |
I do not think ticks10 is incremented twice. The other variable is just ticks. Could it be a bug? I tested the same calling function (timer alone), and it worked fine. maybe the error is not in this part of the code.
void lcd_time(void) { TR1 = 0; IP0 &= 0xF7; // set timer 1 isr priority to 0 IP0H &= 0xF7; TMOD |= 0x01; TAMOD = 0x00; T1_Start(); ET1 =1; EA = 1; } void T1_Start (void) { TR1 = 0; TH1 = (34816); TL1 = (34816); TF1 = 0; TR1 = 1; } 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; } |
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 |