LPIT TMR_CUR_VAL sporadically returning 0xFFFF'FFFF

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

LPIT TMR_CUR_VAL sporadically returning 0xFFFF'FFFF

1,268 Views
maddinhoffmann
Contributor I

We are using one LPIT channel as free running counter to measure execution times.

Sporadically, the LPIT current value register returns 0xFFFF'FFFF, although the actual counter value is different.

The counter reload value is not equal to 0xFFFF'FFFF, so I don't expect to read this value at all, while the timer is running.

DBG_EN and DOZE_EN are set to 0.

Is there any known issure regarding the LPIT timer wrt. to the described behavior?

Thanks!

Martin

0 Kudos
2 Replies

1,024 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,
We dealt with this problem recently. Reading/polling of this register can return invalid data.
The answer provided by design team:
“The LPIT was designed to be mainly used for interrupts and timeouts (in Compare and Accumulator modes). Only in capture mode does the timer value need to be read and this value is stable when read after an interrupt. Thus, there is no use case when software will need to know the current value of the timer when it is running.”

Could you please use another timer (FTM, LPTMR, RTC, SysTick, DWT) for your use case?

Thank you,

Daniel

0 Kudos

1,024 Views
maddinhoffmann
Contributor I

It seems, that this happens only when using SIRC_DIV2 as timer clock.

When using SOSC_DIV2 I cannot reproduce the behavior.

0 Kudos