So here is the initialisation of the PIO interrupts:
Code:
{
AT91F_AIC_ConfigureIt ( AT91C_BASE_AIC, AT91C_ID_PIOB, PIO_INTERRUPT_LEVEL, AT91C_AIC_SRCTYPE_POSITIVE_EDGE,( void (*)( void ) ) ISR_DIentry);
AT91F_AIC_EnableIt( AT91C_BASE_AIC, AT91C_ID_PIOB);
AT91F_AIC_ConfigureIt ( AT91C_BASE_AIC, AT91C_ID_PIOA, PIO_INTERRUPT_LEVEL, AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE,( void (*)( void ) ) ISR_DIentry);
AT91F_AIC_EnableIt( AT91C_BASE_AIC, AT91C_ID_PIOA);
AT91F_PIO_InterruptEnable(AT91C_BASE_PIOB, DI3_PIO);
AT91F_PIO_InterruptEnable(AT91C_BASE_PIOA, DI2_PIO);
AT91F_PIO_InterruptEnable(AT91C_BASE_PIOB, DI1_PIO);
}
and the timer interrupt:
Code:
{
AT91F_AIC_ConfigureIt ( AT91C_BASE_AIC, AT91C_ID_TC0, PIO_INTERRUPT_LEVEL, AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, ( void (*)( void ) )TIMER_DIentry);
AT91F_AIC_EnableIt( AT91C_BASE_AIC, AT91C_ID_TC0);
AT91C_BASE_TCB->TCB_BMR=0x15;
AT91C_BASE_TC0->TC_IER=0x10;
AT91C_BASE_TC0->TC_RC=0x249f;
AT91C_BASE_TC0->TC_CMR=0xC003;
AT91C_BASE_TC0->TC_CCR=0x5;
}
Both clocks get activated elsewhere. I am not reading the PIO->ISR in any other function than the PIO interrupt.