FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [September 2011 Threads] Configure "configTICK_RATE_HZ"Posted by Anuradha on September 1, 2011 All,
I am using FreeRTOS with STM32L.
Currently I have configured "configTICK_RATE_HZ" parameter in FreeRTOSConfig.h to be 1000. I want to change this parameter to 250.
There are vTaskDelay()s and xTicksToWait defined in my code. Is it possible to achieve the same delay miliseconds I achieved with Tick rate 1000 in Tick rate 250, without changing the figures i used at vTaskDelay()s and xTicksToWaits?
Thank you. Anuradha
RE: Configure "configTICK_RATE_HZ"Posted by Richard Damon on September 1, 2011 If you wrote the delays as plain numbers, no. The key to making these delays "constant" over varying tick rates is to compute the value based on configTICK_RATE_HZ like vTaskDelay(delayms * configTICK_RATE_HZ/1000)
I tend to define a macro to do the conversion and use it on all delays that are specified in ticks, so that I can specify them in ms and not need to worry if I adjust the tick rate.
There is one hack you could do if this is too much work to do it right, and that is change the tick interrupt to call the tick increment routine 4 times.
RE: Configure "configTICK_RATE_HZ"Posted by Mike on September 1, 2011 If these are defined in terms of portTICK_RATE_MS, defined in portmacro.h, then timings will still be correct.
If not they won't, but it should be worth changing the definitions from (say) counts (in ticks) to delay_ms / portTICK_RATE_MS. If these are all constants, the compiler will work them out.
Regards
RE: Configure "configTICK_RATE_HZ"Posted by Richard on September 1, 2011 Provided you keep configTICK_RATE_HZ at or below 1000, you can defined delays in milliseconds using:
5000 / portTICK_RATE_MS (for 5 seconds) 250 / portTICK_RATE_MS (for 250 milliseconds) etc.
Then changing configTICK_RATE_HZ will not effect the delay period as portTICK_RATE_MS will be adjusted automatically.
There are lots and lots and lots of examples of this in the set of standard demo tasks that are used in all the demo applications included in the FreeRTOS download.
Regards.
RE: Configure "configTICK_RATE_HZ"Posted by Richard on September 1, 2011 Everybody answered at once ;o)
RE: Configure "configTICK_RATE_HZ"Posted by Anuradha on September 2, 2011 All,
Thanks for replying.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|