| ??? 12/09/03 22:48 Read: times |
#60274 - LPC932 Timer 0 Timer Mode |
Hi, I have configured Timer 0 of the LPC932 to count about one second and then display 0x55 on port 2. Is the timer right configured?
I do not know why it is not executing the ISR. How could I test this better. Will this work? Thank you! void Time_Base(void) { ET0 =1; TR0 = 0; TMOD |= 0x01; TAMOD = 0x00; // 7.373MHz internal RC oscillator TH0 = (65536-30720)/256; // 34816, TL0 = (65536-30720)%256; // .2 TF0 = 0; TCON = 0x10; EA = 1; } void timer(void) interrupt 1 { Time_Base(); Sec_Counter++; if (Sec_Counter == 20) // if 1 sec have passed { Sec_Counter = 0; TR0 = 0; P2 = 0x55; } } |



