Configuration : configTICK_RATE_HZ

Dear Free-RTOS,
We are executing the tasks periodically with equal priority, the context switching of the tasks done with fixed time splice using configTICK_RATE_HZ i.e…,
The maximum configurable delay achieved second.
My Question, " Is it possible to configure (configTICK_RATE_HZ ) greater than one second?"

The highest possible tick frequency will be the frequency at which all processing time is spent inside the tick interrupt handler. The lowest possible tick frequency depends on the timer you use to create the tick interrupt. For example, if it is a 64-bit timer clocked slowly it could be months, if it is an 8-bit timer clocked quickly it could be miliseconds.

Why do you want the tick rate to be greater than a second? 100ms would be typical. Your question makes me think either you don’t understand what the parameter does, or you don’t understand how to use the tick time.

It is difficult to understand your question.

You are asking if a “rate” can be a second. A rate is typically something-per-something-else, and configTICK_RATE_HZ stands for ticks-per-second.

@rtel writes that 10 Hz is a typical frequency. Personally I like a 1000 Hz because my processes often require short sleeps of a few milliseconds.

Do you want a frequency of less than 1 tick per second? One problem is that the macro configTICK_RATE_HZ should express an unsigned integer number, you can not give it a value like 0.5

I many situations, the clock tick is a measure for time-outs. Many API’s have a time-out parameter of type TickType_t. Now if a tick lasts one second, the time-outs can not be fine-tuned.
Also note that vTaskDelay() will use ticks that last a whole second.

Is there any possibility of increasing time-slice greater than 1 Second ?

Probably, but wold you really want to?

To my knowledge, FreeRTOS itself (at least the kernel) doesn’t use configTICK_RATE_HZ for anything other than in the porting layer to setup the clocks. On most ports, this code is replaceable if you create your own tick setup code, so if you can actually program the tick to be that slow, you could supply your own setup code to configure it that way.

As mentioned, the question is why you want that slow of a tic?

1 Like