I have read this answer.
My understanding is, there are actually 2 lines logically:
clock/gating line
event/interrupt line
And the clock/gating line can make the circuit take event input at an instant (edge triggering) or during a period (level-triggering).
So what if an event happens but the edge hasn't arrived yet.
Will that event be missed? Is that by intention?
ADD 1 - 12:21 PM 11/4/2022
I think my confusion lies in the 2 different meanings of triggering:
Meaning 1: Triggering a circuit. Like in the edge-triggered D flip-flop.
Meaning 2: An indication of the occurrence of an interrupt. Such indication can be in the form of a transient edge or by a long-lasting level.
There are 2 paradigms to indicate an interrupt event.
Paradigm 1: Indicated via an edge. The interrupt event signal is first latched. The latch is part of the microcontroller. The latch is necessary to avoid missing the transient interrupt event.
Paradigm 2: Indicated via a level. The latch is not necessary because the level is long-lasting. And the interrupt handler should service until the interrupt level disappears and then re-arm the interrupt, as @steve-mathwig said in his reply.
Btw, the 2 paradigms are the two very natural classification. And I think these are the only two paradigms.
Being edge-triggered interrupt doesn't necessarily mean the interrupt flag is cleared automatically. It can also require manual clearance. Depending on the hardware design.
But being level-triggered interrupt requires the service handler to service until the interrupt pin returns to the inactive level. And this implies "checking if there is more work to do before exit" and "re-arming the interrupt to be told when there is more work to do" as @simon-richter said.
Edge-triggered interrupt doesn't have a chance to withdraw its request. Because once it is latched by the microcontroller, the interrupt source can no longer control it.
Level-triggered interrupt can withdraw its request as long as it is not serviced yet. Such as when the microcontroller is busy processing a previous interrupt and disabled the interrupt. Such withdrawn interrupt will be silently missed. I think this must be the "blind-spot" as @simon-richter commented to his reply.
If another level-triggered interrupt happens just as the interrupt handler finished the handling and checks the interrupt pin for inactive-level, this may cause the "false positive" as @simon-richter commented. And I think this will cause the interrupt handler to repeat its handling.
If the handler for level-triggered interrupt doesn't service until the inactive-level appears, the handler will be invoked immediately after exiting. That's why the handler must ensure an inactive-level before exiting. Though it is not 100% accurate.
The edge-triggered interrupt may also have the blind-spot issue because the latch can only record one event even if there are multiple interrupt events happening while the handler is still busy executing or interrupt mechanism is disabled.
So the next natural question is, how to choose between edge-triggering or level-triggering paradigm for an interrupt?
I remember someone told me that edge-triggering is more vulnerable to the glitches while level-triggering is much more robust.
there are actually 2 lines
... are you certain ... interrupt pins are usually not in pairs ... are you confusing an interrupt pin with a data pin? \$\endgroup\$