- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to run a driver example of TSTMR module on iMX93EVK board.
The example demonstrates the usage of the timer by introducing a delay of 1 sec (using TSTMR_DelayUs()) and captures the time stamps before and after the delay (using TSTMR_ReadTimeStamp()) and displays them on COM/serial port of Cortex M33
As per the readme.md of the driver example, I am supposed to see a difference of 1 sec between the start and stop time stamps of the delay as follows :
(End time - start time = F4AB0 ~ 1 sec)
But in my application I am observing that, the difference is being scaled by a factor of 24 as follows :
~~~~~~~~~~~~~~~~~~~~~~
Timestamp1 = 03f377be6
Test the delay function, delay for 1 second
Start time = 03f3a218d
End time = 040a948e4
~~~~~~~~~~~~~~~~~~~~~~
(End time - start time = 16F 2757 ~ 24 sec)
Also, I noticed that, the TSTMR is operating at 24 MHz (whereas in readme.md it was mentioned as 1 MHz), so I am not sure if the scaling is related to the clock frequency
So, can someone help me in resolving this issue?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're absolutely right! Since TSTMR operates at 24 MHz, TSTMR_ReadTimeStamp() will return the number of clock cycles. To convert this to microseconds, you need to divide by 24 (since 1 MHz = 1 µs).
So, the time elapsed in microseconds would be:
This should give you the correct timing in µs. Let me know if you need further clarification!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @Vikas7Bal
I hope you are doing very well.
Thank you for contact to NXP support :).
After an investigation, you are right, there is a discrepancy between the Readme and reference Manual.
You can see on Table 134. Clock Root Table of Reference Manual, tstmr is running at 24 MHz, not 1MHz as suggest the readme.
Please ignore readme file. TSTMR is running at 24 MHz.
Best regards,
Salas.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Manuel_Salas , thanks for your quick reply and explanation.
I have one more question, since now it is confirmed that TSTMR is operating at 24 MHz, so the TSTMR_ReadTimeStamp(), will report the clock cycles, and in order to get the actual time elapsed, I think it needs to be scaled down by 24 to get its equivalent in micro seconds (us).
Can you confirm?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're absolutely right! Since TSTMR operates at 24 MHz, TSTMR_ReadTimeStamp() will return the number of clock cycles. To convert this to microseconds, you need to divide by 24 (since 1 MHz = 1 µs).
So, the time elapsed in microseconds would be:
This should give you the correct timing in µs. Let me know if you need further clarification!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
