ImxRT1170 GPT read

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ImxRT1170 GPT read

跳至解决方案
723 次查看
kale
Contributor I

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?

0 项奖励
1 解答
708 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

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

在原帖中查看解决方案

0 项奖励
4 回复数
696 次查看
kale
Contributor I

Thank you for speedy help Kerry!

0 项奖励
715 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

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.

  

kerryzhou_0-1654071043888.png

kerryzhou_1-1654071051914.png

kerryzhou_2-1654071062837.png

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

 

 

 

 

0 项奖励
711 次查看
kale
Contributor I

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?

0 项奖励
709 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

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

0 项奖励