|
SOLUTION TO THE PROBLEM, use AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL.
It's been along time since this topic started but since this thread gets high Google scores it would be nice to present a solution the problem. Initialization should be AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL not AT91C_AIC_SRCTYPE_POSITIVE_EDGE. Do not confuse the external IRQ with the internal. The PIO sets the internal IRQ to the AIC at both positive and negative edges from the external signal. This has nothing to do with a AT91C_AIC_SRCTYPE_POSITIVE_EDGE to the AIC. The selection of the edge to service is a SW matter in the IRQ service routine. By faulty telling the AIC to react on edges instead of levels the AIC will not react on IRQ's that occur between when reading the AT91C_BASE_PIOA->PIO_ISR and reading the AT91C_BASE_AIC->AIC_EOICR Solutions like "do a shorter IRQ handler" is wrong, since it always will be an even so small window where IRQ events are lost. On top of that, if an event is lost, the AT91C_BASE_PIOA->PIO_ISR would not be reseted and therefore will subsequent transitions on the I/O line not generate new IRQ's.
|