
AT32F413
Series Reference Manual
2022.06.27
Page 102
Rev 2.00
8
External interrupt/Event controller (EXINT)
8.1 EXINT introduction
EXINT consists of 19 interrupt lines EXINT_LINE[18:0], 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
independenttly through software configuration, and utilizes different edge detection modes (rising edge,
falling edge or both edges) as well as trigger modes (edge detection, software trigger or both tirggers)
to respond to the trigger source in order to 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-18
PVM
输出
EXINT_LINE[16]
RTC
闹钟事件
EXINT_LINE[17]
USB
唤醒事件
EXINT_LINE[18]
EXINT_LINE0-18
上升沿
检测
下降沿
检测
EXINT_POLCFG1[18:0]
EXINT_POLCFG2[18:0]
EXINT_SWTRG[18:0]
EXINT_INTEN[18:0]
Interrupt0-18
EXINT_EVTEN[18:0]
Event0-18
Main features:
EXINT 0~15 mapping IO can be configured independently
Independent trigger selection on each interrupt line
Independent enable bit on each interrupt
Independent enable bit on each event
Up to 19 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 19 interrupt lines EXINT_LINE[18:0], EXINT can detect not only GPIO external interrupt
sources but also internal sources such as PVM output, RTC alarm events and USB wakeup events
through edge detection mechanism, where, 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 several 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 events 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 independently through software configuration such as
EXINT_INTEN and EXINT_EVTEN register, indicating that the corresponding interrupt or event must be
enabled prior to either edge detection or software trigger.
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.
Interrupt initialization procedure
Select an interrupt source by setting IOMUX_EXINTCx register (This step is required if GPIO is
used as an interrupt source)
Select an trigger mode by setting EXINT_POLCFG1 and EXINT_POLCFG2 register
Enable interrupt or event by setting EXINT_INTEN and EXINT_EVTEN register