hi all
this is how i initialize the timer1
void init_timer1(void) { T1MR1 = 15999999;//15990; T1MCR = 3; T1TCR = 1; T1CTCR = 0x00; VICVectAddr5 = (unsigned long)T1_IRQHandler; VICVectCntl5 = 14; VICIntEnable = (1 << 5); }
__irq void T1_IRQHandler (void) { volatile unsigned int pin_status; pin_status = FIO4PIN;
if((pin_status & 0x20000000) == 0x20000000) { FIO4CLR |= 0x20000000; } else { FIO4SET |= 0x20000000; } }
this timer1 is not working in timer0 and timer1 i have initialized as similar which toggles the pin every one sec.here timer0 generates the interrupt and i get the pin toggled but i have the problem with timer1 the pin doesnt toggle so i doubt tht timer1 is not initialized or its not able to generate interrupt so can any one help me to rectify the doubt i have given the code how i initialize the time and the interrupt code ...the default PCONP is set .
Regards suresh
Why a new thread - and still with incorrectly posted source code? Kill off this thread, and return to the original thread.
I forgot the obligatory link to the "correct" thread: http://www.keil.com/forum/docs/thread10860.asp
the above code works for timer0 but not for timer1 so wt might be the problem ......do i have to set any other register to make it work
If you expect answers, please keep your discussion in the correct thread!
Starting a new thread wastes other peoples time, since they don't know what have already been discuessed! If that is important to you, please show that!
View all questions in Keil forum