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?
解決済! 解決策の投稿を見る。
The problem was in SIM_SCGC5. We didn't enable LPTMR bit before reading CNR.
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
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.