Hello,
I'm wondering how do you read one of the iMXRT1770 GPT's to return system ticks?
Any examples for how to do this?
Solved! Go to Solution.
Hi @kale ,
Yes, of course, when you open the fsl_gpt.h, you can find this API:
static inline uint32_t GPT_GetCurrentTimerCount(GPT_Type *base)
{
return base->CNT;
}
Wish it helps you!
If your question is solved, please help me to mark the correct answer.
Any new issues, welcome to create the new case.
Best Regards,
Kerry
Thank you for speedy help Kerry!
Hi @kale ,
You may want to mention RT1170, not the RT1770, right?
It is determined whether your systick and the GPT using the same clock source.
You can see, the systick clock can't be the GPT clock source directly.
So, in fact, you can't read the systick clock directly, if your systick and the GPT are the same clock source and start together, then you may use the GPT counter the related clock source number.
In fact, I think it is no meaning, you even can use the systick to read it's own count directly.
Wish it helps you!
Best Regards,
kerry
Thank you for the quick reply Kerry!
That makes sense. Is there any api documentation or example for reading the one of the gpt counters?
Hi @kale ,
Yes, of course, when you open the fsl_gpt.h, you can find this API:
static inline uint32_t GPT_GetCurrentTimerCount(GPT_Type *base)
{
return base->CNT;
}
Wish it helps you!
If your question is solved, please help me to mark the correct answer.
Any new issues, welcome to create the new case.
Best Regards,
Kerry