We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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.
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.