外部中断
系统外设
EXTI特性
管理外部和内部的异步事件
/中断并产生事件请求送到
中断控制器;以及唤醒请求
送到功耗管理模块
某些通信外设(UART、I2C
、CEC、比较器)能在MCU
处于停止模式时产生唤醒事
件来把MCU唤醒
其他特性和STM32F1x系列一
样
Pending Request
Register
Interrupt Mask
Software Interrupt
Rising Trigger
Falling Trigger
Register
Event Register
Selection Register
Selection Register
Edge Detect
Circuit
]
0
:
5
1
[
I
T
X
E
To
NVIC
Pulse
Generator
Event Mask
Register
Up to 28 Interrupt/Events requests :
Up to 55 GPIOs can be used as EXTI line(0..15)
EXTI line 16 is connected to the PVD output
EXTI line 17 is connected to the RTC Alarm event
EXTI line 18 is reserved (internally held low)
EXTI line 19 is connected to RTC tamper and Timestamps
EXTI line 20 is reserved (internally held low)
EXTI line 21 is connected to Comparator 1 output
EXTI line 22 is connected to Comparator 2 output
EXTI line 23 is connected to I2C1 wakeup
EXTI line 24 is reserved (internally held low)
EXTI line 25 is connected to USART1 wakeup
EXTI line 26 is reserved (internally held low)
EXTI line 27 is connected to CEC wakeup.
1
扩展的中断/事件控制器
28个中断/事件请求
外部中断/事件线:21条
内部中断/事件线:7条(其中4个保留)
I2C1唤醒、USART1唤醒、CEC唤醒
仅在STOP模式下,以上三个内部线才起作用
中断
事件
外部线
内部线
设置希望检测的边沿@RTSR、FTSR;
设置中断掩码来使能中断请求@IMR;
配置NVIC相应通道
一旦边沿到来,产生中断请求并置位挂起位
总是检测上升沿;
中断请求被默认使能;
中断到来后并无挂起标志
(内部线的挂起在它自己的IP寄存器中)
设置希望检测的边沿@RTSR、
FTSR;
使能事件请求@EMR;
一旦所选边沿到来,产生事
件脉冲,不会置位挂起位
事件是一个简单脉冲,用来
触发内核唤醒
注意
1.对于外部线,还可软件产生中断/事件;内部线则不行
2.内部线只有在STOP模式下才能产生中断/事件;非STOP模式下内部线被自动关闭
2
寄存器组:中断、事件掩码配置
内部线默认产生中断,也可以配置产生事件
3
寄存器组:边沿选择
可以同时选择上升沿和下降沿
外部线可由用户配置检测的边沿;内部线固定检测上升沿
4
寄存器组:软件触发和挂起状态
当位为0时,软件置1会硬件置位挂起状态位;如果该外部
线使能了中断掩码,则产生中断请求
软件产生中断,只针对外部线
挂起状态位只针对外部线
5
Quiz
How many lines does have the Extended interrupt controller
support?
____________
Which lines are mapped to a special asynchronous events ?
____________
Which lines can be used as system wake-up ?
____________
6