In the LPIT implementation of the S32K series one cannot rely on the current timer value, see Problem with LPIT and LPIT TMR_CUR_VAL sporadically returning 0xFFFF'FFFF .
Does anybody know if this is also applies on the KE1xF? There is no hint in the manual as it is on the S32K but the implemenation seems to be similar.
I have checked the errata of KE1xF, it does not mention the issue of LPIT.
I want to know whether it is a debugger issue or LPIT itself. If you set up the LPITx_TVALn register with a large value and use FTM, SYSTICK...module to generate a fixed cycle time interrupt, in the ISR, read the LPITx_CVALn to a buffer, after the buffer is full, check the buffer, what is the result?
I'm using the LPIT only for unimportant time measurements on the KE1xF but I did not see any problem. I just wanted to know if the same problem as on the S32K can happen as well.
I've tried your suggestion to read out the timer value in a buffer. The timer value was monotonically decreasing without any problem.
So it seems the LPIT on the KE1xF could be used for time measurements.
Mark, thank you for pointing me to the instruction counter. I will have a look on it.
The LPIT implementation is very probably identical in all parts using it (however check the errata sheets to see if there are know restrictions in the particular version used).
Since the KE1xF has a Cortex-M4 core you may also be interested in its 32 bit instruction counter (in the Data Watch and Trace Unit) which gives core clock resolution for time stamps.
For less questions and faster, cheaper developments: try uTasker for Kinetis