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
746 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?

0 Kudos
Reply
1 Solution
626 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
Reply
2 Replies
627 Views
testertester
Contributor II

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

0 Kudos
Reply
626 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Tester,

About the register of "LPTMR_CNR" :

- The CNR is reset when the LPTMR is disabled or if the counter register overflows. If

CSR[TFC] is cleared, then the CNR is also reset whenever CSR[TCF] is set.

- And On each read of the CNR, software must first write to the CNR with any value.

About the detail description , please refer to KL26P121M48SF4RM.pdf -> 33.4.5 LPTMR counter .

If you have mentioned this , it still have question , could you please show your code clearly ?

Hope it helps


Have a great day,
Alice

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply