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

Problem with AIC

Hello, I started a project using Advanced interrupt controller. HW is AT91SAM7XC256.

Source code:


void Ext0IrqHandler(void) {
__asm {
NOP
}
  AT91C_BASE_AIC->AIC_EOICR=0;
}


int main(void) {
        /** BOOT SEQUENCE **/

        /* PIO setup */
        AT91F_PIOA_CfgPMC();
        AT91F_PIOB_CfgPMC();

        /* AIC setup */
        AT91F_AIC_CfgPIO();
        AT91F_AIC_CfgPMC();

        // external interrupt 0
        pAIC->AIC_IDCR = (1<<AT91C_ID_IRQ0);   // external interrupt off in AIC
        pAIC->AIC_SVR[AT91C_ID_IRQ0] = (unsigned int)Ext0IrqHandler; // addr set
        pAIC->AIC_SMR[AT91C_ID_IRQ0] = (AT91C_AIC_SRCTYPE_POSITIVE_EDGE | 0x6);
        pAIC->AIC_IECR = (1<<AT91C_ID_IRQ0); // external interrupt on in AIC
        /** END OF BOOT SEQUENCE **/

        while(1) {
        __asm {
                NOP
                NOP
        }
        }

}

The problem is, that the processor enters into IRQ handler only once! It enters it, then goes back to main loop and then it absolutery ignore AIC's NIRQ and Pending flag. When it execute the handler once and it goes back to loop, the processor is still in Interrupt mode.. why? Please help.
Milan P

Parents Reply Children
No data