ImxRT1170 GPT read

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ImxRT1170 GPT read

Jump to solution
713 Views
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 Kudos
1 Solution
698 Views
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

View solution in original post

0 Kudos
4 Replies
686 Views
kale
Contributor I

Thank you for speedy help Kerry!

0 Kudos
705 Views
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 Kudos
701 Views
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 Kudos
699 Views
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 Kudos