I am using a Kinetis MK60 microcontroller and it enters correctly in vlls3 mode.
I want to count the milliseconds that it is in VLLS3 mode. So, I want to use the LPTMR.
This is the code that I called before entering VLLS3:
/* SIM_SCGC5: LPTIMER=1 */
SIM->SCGC5 |= SIM_SCGC5_LPTIMER_MASK; /// Activamos.
LPTMR0->CSR = (LPTMR_CSR_TCF_MASK | LPTMR_CSR_TPS(0x00)); /* Clear control register */
LPTMR0->PSR = LPTMR_PSR_PRESCALE(0x00) | LPTMR_PSR_PBYP_MASK | LPTMR_PSR_PCS(0x01); /* Set up prescaler register */
LPTMR0->CSR = ( LPTMR_CSR_TPS(0x00) | LPTMR_CSR_TFC_MASK | LPTMR_CSR_TEN_MASK); /* Set up control register */
This works correctly.
But when I wake up by LLWU, the LPTMR module is off.
This is because in the SIM_SCGC5 register the SCGC5_LPTMR bit is set to 0.
What can you owe?
How can I operate the Low-Power Timer in low-power mode?