lz在EXTI中断里进入停止模式,并希望使用使用同一个EXTI中断唤醒是不可行的
因为MCU在进入停止模式前仍然在EXTI中断里,中断优先级相同不能打断自己,所以也不能唤醒MCU,lz可以尝试在进入停止模式前调高中断的优先级,可不可行我还没有测试过。
我建议楼主采用下面的方法:
看手册这段
Two options are available to select the Sleep mode entry mechanism,
depending on the SLEEPONEXIT bit in the Cortex-M3 System Control register:
● Sleep-now: if the SLEEPONEXIT bit is cleared, the MCU enters Sleep mode as soon
as WFI or WFE instruction is executed.
● Sleep-on-exit: if the SLEEPONEXIT bit is set, the MCU enters Sleep mode as soon as
it exits the lowest priority ISR.
把SLEEPONEXIT位在中断里置1,那么MCU在退出中断的时候就会自动进入睡眠模式,如果希望唤醒MCU,那么在中断里把这位清0就可以了。
详情回复
发表于 2010-9-14 11:58
我建议楼主采用下面的方法:
看手册这段
Two options are available to select the Sleep mode entry mechanism,
depending on the SLEEPONEXIT bit in the Cortex-M3 System Control register:
● Sleep-now: if the SLEEPONEXIT bit is cleared, the MCU enters Sleep mode as soon
as WFI or WFE instruction is executed.
● Sleep-on-exit: if the SLEEPONEXIT bit is set, the MCU enters Sleep mode as soon as
it exits the lowest priority ISR.