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