DSPRelated.com
Forums

bf532-- timer interrupt --programming problem

Started by gc rashmi November 16, 2005
hi,
i have problem in programming the timer to call its
ISR.
i don't see my LED connected to pf1 blink.
i have read a few example codes & trying to follow the
same. i am posting my code here. please let me know if
my configuration is not all-right or if something
extra is to be added.
thanks in advance,
rashmi

/* program to blink LED using timer interrupt*/

void Init_Timers(void)
{
*pTIMER_DISABLE = 0x0001;
*pTIMER0_CONFIG = 0x0019;
*pTIMER0_PERIOD = 0x0020000;
*pTIMER0_WIDTH = 0x0010000;
*pTIMER_ENABLE = 0x0001;
}

EX_INTERRUPT_HANDLER(Timer0_ISR){
//confirm interrupt handling
*pTIMER_STATUS = 0x0001;

*pFIO_FLAG_T |= LED0; //toggle

}

void Init_Interrupts(void)
{
// assign core IDs to interrupts
*pSIC_IAR0 = 0xffffffff;
*pSIC_IAR1 = 0xffffffff;
*pSIC_IAR2 = 0xfffffff4; // Timer0 -> ID4;
// assign ISRs to interrupt vectors Timer0 ISR -> IVG
11
register_handler(ik_ivg11, Timer0_ISR);

// enable Timer0
*pSIC_IMASK = 0x00010000;
}

int main(){

Init_Timers();
Init_Interrupts();

return 0;
}
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com