AnsweredAssumed Answered

请教MKL16Z128的VLLS3 LLS低功耗问题

Question asked by 天边ttt 陈ttt on Mar 18, 2018
Latest reply on Jun 13, 2018 by Robin_Shen

我现在用MKL16Z128的VLLS3模式遇到了一点问题,我是这样设置的 :用PTC6作为LLWU唤醒, PTC6设置IO口中断输入,下降沿产生中断,LLWU也设置为下降沿中断
现在是进入VLLS3后按按键单片机是进入复位状态,程序重头开始运行,当程序再次进入VLLS3后单片机死机了,

我的VLL3
volatile unsigned int dummyread;
/* Write to PMPROT to allow VLLS3 power modes */
SMC->PMPROT = SMC_PMPROT_AVLLS_MASK;
/* Set the STOPM field to 0b100 for VLLS3 mode */
SMC->PMCTRL &= ~SMC_PMCTRL_STOPM_MASK;
SMC->PMCTRL |= SMC_PMCTRL_STOPM(0x4);
/* set VLLSM = 0b11 */
SMC->STOPCTRL = SMC_STOPCTRL_VLLSM(3);
/*wait for write to complete to SMC before stopping core */
dummyread = SMC->STOPCTRL;
/* Now execute the stop instruction to go into VLLS3 */
#ifdef CMSIS
/* Set the SLEEPDEEP bit to enable deep sleep mode (STOP) */
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
__wfi();
#else
stop();
#endif
程序是这样的

进入休眠之前
LLWU->F2 |= LLWU_F2_WUF10_MASK; // write one to clear the flag
NVIC_EnableIRQ(LLW_IRQn);
LLWU->PE3 = 0x20; //下降沿中断
这样设置
LLWU中断
void LLWU_IRQHandler(void)
{
if(LLWU->F2 & LLWU_F2_WUF10_MASK)
{
f_pmt = 1;
LLWU->F2 |= LLWU_F2_WUF10_MASK; // write one to clear the flag
}
}

 

当我把休眠模式设置为LLS模式后,单片机进入LLS模式后却出不来

Outcomes