[En-Nut-Discussion] Interrupts on at91 plattform: Edge vs. level triggered

Ole Reinhardt ole.reinhardt at embedded-it.de
Tue Feb 3 18:19:29 CET 2009


Hey!

I just noticed several times problems with drivers using edge triggered
interrupts on the arm platform. At least you remember the UART bug,
fixed at 2008-07-26 by Harald (see Changelog).

I noticed similar problems with the GPIO level change interrupts as
well. If I leave the interrupts in their default trigger mode (edge
triggered) the interrupt handler will not be triggered again after some
thousand interrupts where generated before. It seems that this might
happen if the Interrupts are disabled by a critical section just in the
moment when the interrupt occurs. It seems that the interrupt flag is
set in the meantime and therefore will never change again until it is
cleared. But it will only be cleared in the interrupt handler which was
not called as there was no "change" detected when interrupts where
enabled.

So two questions:

- Is there any reason to use edge triggered interrupts instead of level
  triggered for the internal peripherals?
- If yes: Is there any way to workaround this problem? For example by
  checking if an interrupt should have been triggered when leaving the
  critical section?

We should carefully check all existing drivers if this problem might
occur there too. Especialy this could solve the problems with the TWI
driver too (not yet checked).

Regards,

Ole Reinhardt

-- 
 _____________________________________________________________
|                                                             |
| Embedded-IT          Hard- und Softwarelösungen             |
|                                                             |
| Ole Reinhardt        Tel. / Fax:        +49 (0)271  7420433 |
| Luisenstraße 29      Mobil:             +49 (0)177  7420433 |
| 57076 Siegen         eMail:    ole.reinhardt at embedded-it.de |
| Germany              Web:         http://www.embedded-it.de |
|                      UstID / VAT:       DE198944716         |
|_____________________________________________________________|




More information about the En-Nut-Discussion mailing list