MKL26Z256 LPTMR0_CNR value after wake up from VLLS1

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MKL26Z256 LPTMR0_CNR value after wake up from VLLS1

ソリューションへジャンプ
1,089件の閲覧回数
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?

ラベル(1)
0 件の賞賛
返信
1 解決策
971件の閲覧回数
testertester
Contributor II

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

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
972件の閲覧回数
testertester
Contributor II

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

0 件の賞賛
返信
971件の閲覧回数
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 件の賞賛
返信
971件の閲覧回数
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 件の賞賛
返信