AT32F421
Series Reference Manual
2022.11.11
Page 95
Rev 2.02
8
External interrupt/Event controller (EXINT)
8.1 EXINT introduction
EXINT consists of 22 interrupt lines EXINT_LINE[21:0] (Line 18 and Line 20 are reserved), each of
which can generate an interrupt or event by edge detection trigger or software trigger. EXINT can
enable or disable an interrupt or event independently through software configuration, and adopt
different edge detection modes (rising edge, falling edge or both edges) as well different trigger modes
(edge detection, software trigger or both triggers) to respond to the trigger source and generate an
interrupt or event.
Figure 8-1 External interrupt/Event controller block diagram
PAx(x=0~15)
EXINTx(x=0~15)
EXINT_LINE0-15
PBx(x=0~15)
PCx(x=0~15)
PDx(x=0~15)
PEx(x=0~15)
EXINT_LINE16-21
PVM output EXINT_LINE[16]
ERTC alarm event EXINT_LINE[17]
ERTC tamper and time stamp event
EXINT_LINE[19]
COMP event EXINT_LINE[21]
EXINT_LINE0-21
Rising
edge
Falling
edge
EXINT_POLCFG1[21:0]
EXINT_POLCFG2[21:0]
EXINT_SWTRG[21:0]
EXINT_INTEN[21:0]
Interrupt0-21
EXINT_EVTEN[21:0]
Event0-21
Main features:
EXINT 0~15 mapping IO can be configured independently
Independent trigger mode selection on each interrupt line
Independent enable bit on each interrupt
Independent enable bit on each event
Up to 20 software trigger that can be generated and cleared independently
Independent status bit on each interrupt
Each interrupt can be cleared independently.
8.2 Function overview and configuration procedure
With up to 22 interrupt lines EXINT_LINE [21:0] (Line 18 and Line 20 are reserved), EXINT can detect
not only GPIO external interrupt sources but also internal sources such as PVM output, ERTC alarm,
and ERTC tamper and time stamp events. The GPIO interrupt sources can be selected with
IOMUX_EXINTCx register. It should be noted that these input sources are mutually exclusive. For
example, EXINT_LINE0 is allowed to select only one of PA0/PB0/PC0/PD0 pins…, instead of taking
both PA0 and PB0 as the input sources at the same time.
EXINT supports multiple edge detection modes, including rising edge, falling edge or both edges,
selected by EXINT_POLCFG1 and EXINT_POLCFG2 register. Active edge trigger detected on the
interrupt line can be used to generate an event or interrupt.
In addition, EXINT supports independent software trigger for the generation of an event or interrupt. This
is achieved by setting the corresponding bits in the EXINT_SWTRG register.
EXINT can enable or disable an interrupt or event individually through software configuration such as
EXINT_INTEN and EXINT_EVTEN registers, indicating that the corresponding interrupt or event control
bit must be enabled in advance.
EXINT also features an independent interrupt status bit. Reading access to EXINT_INTSTS register can
obtain the corresponding interrupt status. The status flag is cleared by writing “1” to this register.