This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARGGHHHH....Interrupt vector keeps getting called...!!!

I am using the Atmel At91SAM7S-EK with the 256k micro.

I have set up a simple interrupt vector to an ISR which simply acknowledges the interrupt and then exits. However, when the interrupt is entered, it does its business and then exits, to be called again (from the startup.s code) forever after............

Here is the offending code :

void system_int (void) __irq
{        /* System Interrupt Handler */

    AT91S_AIC * pAIC = AT91C_BASE_AIC;
        AT91S_PITC * pPIT = AT91C_BASE_PITC;

    *AT91C_AIC_EOICR = pPIT->PITC_PIVR;     /* Ack & End of Interrupt */
        //*AT91C_AIC_EOICR = 0;                   /* End of Interrupt */
}


void init_timer (void) {                    /* Setup PIT with Interrupt */
  AT91S_AIC * pAIC = AT91C_BASE_AIC;

  *AT91C_PITC_PIMR = AT91C_PITC_PITIEN | AT91C_PITC_PITEN | PIV;                   /* Periodic Interval Value */

/* Setup System Interrupt Mode and Vector with Priority 7 and Enable it */
  pAIC->AIC_SMR[AT91C_ID_SYS] = AT91C_AIC_SRCTYPE_INT_EDGE_TRIGGERED | 7;
  pAIC->AIC_SVR[AT91C_ID_SYS] = (unsigned int) system_int;
  pAIC->AIC_IECR = (1 << AT91C_ID_SYS);
}

Any ideas,
yours completely lost and fed up
Marcus.

Parents
  • Hello Marcus,

    it seems that you did not clear interrupt source so please add this code:
    *AT91C_AIC_ICCR = (1 << AT91C_ID_SYS);

    in your interrupt handler before line:
    *AT91C_AIC_EOICR = pPIT->PITC_PIVR; /*Ack & End of interrupt */

    and try then.

Reply
  • Hello Marcus,

    it seems that you did not clear interrupt source so please add this code:
    *AT91C_AIC_ICCR = (1 << AT91C_ID_SYS);

    in your interrupt handler before line:
    *AT91C_AIC_EOICR = pPIT->PITC_PIVR; /*Ack & End of interrupt */

    and try then.

Children
No data