Can FreeRTOS support xTimerCreate() with us?

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

Can FreeRTOS support xTimerCreate() with us?

1,407 Views
maxs_yeh
Contributor I

Hi,

I am using SDK_2.8.5_EVK-MIMXRT1060 with FreeRTOS version.

I want to create a timer handling function with us timer, but I check the timers.h that described the xTimerPeriodInTicks parameter used portTICK_PERIOD_MS not us.

Please kindly suggest the solution.

Thanks.

 

0 Kudos
Reply
2 Replies

1,393 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi maxs_yeh,

   The software timer need to input the xTimerPeriodInTicks is the configTICK_RATE_HZ integer multiples.

   Take the SDK freertos_swtimer as an example:

#define configTICK_RATE_HZ ((TickType_t)200)

  it means the cpu freertos tick time is 1/200=50ms

   So, it means that your defined time must be the integer multiples to 50 ms, should be: 50ms, 100ms, 150ms...etc. that's why you can't get the us.

   Then you may think, whether you can set the configTICK_RATE_HZ in the us level. 

   As you know, the smaller tick time is, the heavy cpu load is.

   So, just as nickwallis told you, if you really need the us timer, you can use the RT hardware Timer to generate it.

 

Wish it helps you!

If you still have questions about it, please kindly let me know!

Best Regards,

Kerry

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

-----------------------------------------------------------------------------

0 Kudos
Reply

1,401 Views
nickwallis
Senior Contributor I

For timing events of less than one microsecond, you need to use hardware timers directly rather than freeRTOS services. i.MX RT has multiple timers, but you could look at either the PIT or GPT as a starting point.

-Nick

0 Kudos
Reply