MKL26Z256 LPTMR0_CNR value after wake up from VLLS1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MKL26Z256 LPTMR0_CNR value after wake up from VLLS1

Jump to solution
792 Views
testertester
Contributor II

We use LLWU to wake up the MCU. There are different sources to wake up: CMP, gpio and LPTMR. When we wake up by CMP or gpio, we have to get a value from LPTMR0_CNR to find sleep time. But it is always 0. Is there any recomendations to get LPTMR0_CNR after VLLS1?

Labels (1)
0 Kudos
1 Solution
674 Views
testertester
Contributor II

The problem was in SIM_SCGC5. We didn't enable LPTMR bit before reading CNR.

View solution in original post

0 Kudos
3 Replies
675 Views
testertester
Contributor II

The problem was in SIM_SCGC5. We didn't enable LPTMR bit before reading CNR.

0 Kudos
674 Views
Paul_Tian
NXP Employee
NXP Employee

Hi, Tester

LPTMR has four clocking sources can be selected. But not all these four clock source can be used under VLLS1 mode. So you can check if you use the correct clock source, for example, LPO.

Hope it can help you.

Best Regards

Paul

0 Kudos
674 Views
testertester
Contributor II

Hello!

    We use LPO as a clock source.

     Here is a part of generated by PE code.

LPTMR_PDD_SelectPrescalerSource(LPTMR0_BASE_PTR, LPTMR_PDD_SOURCE_LPO1KHZ); /* Set clock source */

     LPTMR works as expected, it wakes up the MCU according to it's settings. The problem is when we wakes up from other sources before LPTMR interrupt. This time we can't get actial value of CNR.

0 Kudos