AnsweredAssumed Answered

Cannot exit from VLPS Mode in KL05Z

Question asked by Varun Rajarangan on Nov 27, 2015
Latest reply on Nov 30, 2015 by Varun Rajarangan

Hi there,

 

I am trying to implement VLPS mode in FRDM-KL05Z dev board.

I configured LPTMR to wakeup from sleep.

It is working perfectly in debug mode.

But in normal mode (without codewarrior debug support), it is going to sleep mode, but unable to wake up using the LPTMR interrupt.

 

These are the functions...

 

/* Low Power Timer Interrupt Service Routine*/

void LPTimer_IRQHandler(void){

    unsigned static char temp1 = 0;

    LPTMR0_CSR |= LPTMR_CSR_TCF_MASK;        //   

    LPTMR0_CSR |= LPTMR_CSR_TEN_MASK;        // Enable Timer

    temp1++;

    PORTB_TOGGLE(8);

    SMC_PMCTRL &= ~SMC_PMCTRL_STOPM_MASK;

    SCB_SCR &= ~(SCB_SCR_SLEEPDEEP_MASK | SCB_SCR_SLEEPONEXIT_MASK);

    }

 

SetPowerMode(uint8_t mode){

    uint8_t temp1 = 0;

    SMC_PMPROT = 0x22;                                                             // Allow Low Leakage Power Modes (VLPR,VLPW,VLPS,LLS)

    SMC_PMPROT = SMC_PMPROT_AVLP_MASK;                      //    

    SMC_PMCTRL &= ~SMC_PMCTRL_STOPM_MASK;               //

    SMC_PMCTRL |=  SMC_PMCTRL_STOPM(0x2);                     //

    temp1 = SMC_PMCTRL;                                                           // Dummy read

    }

 

void GotoSleep(){

    SCB_SCR|=SCB_SCR_SLEEPDEEP_MASK;                            // Enable ARM deep sleep modes

    __asm("DSB");

    __asm("WFI");                                                                             // Go to sleep

    __asm("ISB");

    }

 

Please help me to resolve this issue.

 

Thanks and regards

Varun Rajarangan

Outcomes