How to introduce a 20ms timer configuration in GPT in S32K344

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

How to introduce a 20ms timer configuration in GPT in S32K344

955 Views
yash_bhatnagar9
Contributor II

Hi,

I am using S32K344 and I want to introduce a timer for 20ms task in my code. How to I add the configuration for that in EB Tresos. If possible can anyone share the Tresos configuration for the same.

Tags (2)
0 Kudos
1 Reply

941 Views
cuongnguyenphu
NXP Employee
NXP Employee

Hi @yash_bhatnagar9 ,
There's an example in S32K3 RTD package, which config timer for GPT "Gpt_Example_S32K344".
You need to check the GptChannelTickFrequency of that config:

cuongnguyenphu_0-1669193056884.png


For example, the TickFrequency is 24Mhz (means 1 second has 24Mhz ticks), then you need to have 480000 ticks for 20ms.

In your source code, you need to start a timer with this tick value, then you just need to modify this value in the example code:

cuongnguyenphu_1-1669193284668.png

 

0 Kudos