AnsweredAssumed Answered

Cannot get Timer0 interrupt

Question asked by BillH on Jan 19, 2013
Latest reply on Jan 23, 2013 by MaheshN

I am trying to use Timer 0 on a SHARC ADSP-21369 for a simple periodic interrupt.

My Timer ISR and initialization are shown below. I am pretty sure the interrupt is never happening.

Can anyone tell me what I've missed?

 

static void Timer0Svc (int Dummy)
{
   *pTMSTAT = TIM0IRQ; /* Clear the Interrupt */

   OutputCtl (DPI6_CTL, CTL_TGL); /* Toggle Signal */
}

 

/* Initialization Segment */

   #define T0_MSEC_DIV_VAL (PCLK_HZ / 1000)

   interrupt (GPTMR0I, Timer0Svc); /* Enbl Timer 0 Interrupt */

   *pTM0CTL = TIMODEPWM | PRDCNT | IRQEN; /* PWM Mode */

   *pTM0PRD = T0_MSEC_DIV_VAL;

   *pTM0W   = T0_MSEC_DIV_VAL / 2;

   *pTMSTAT = TIM0EN; /* Enable Timer 0 */

Outcomes