How to choose best TICK_RATE_HZ?

willywortel wrote on Tuesday, February 17, 2009:

Hi all (again),

In the documentation, it is stated that the default (1000hz) tick is higher than normally would be required.

What I notice is, that when i increase the tick count to 1050hz I never get a tick count.
This happens only when there is a task available. When I just start the scheduler, i can get as high as 10.000
without any problem. I get the tick count by using a trace macro on the PIC32.
What is this about? The task that is running is the only task and has nothing in it (except a continuous loop).

But my main question is, what is the best (highest) tick count without (crashing) sooner or later the tick count?

willywortel wrote on Tuesday, February 17, 2009:

Sorry, had to add this text too.

And when I select a tick rate off 100, the task will run continuously. (Also measured using trace functions)

This is the tasks only function:

    while(1){
        vTaskDelay(5 / portTICK_RATE_MS );
       
    }

davedoors wrote on Tuesday, February 17, 2009:

portTICK_RATE_MS will be less than 0 if configTICK_RATE_HZ is greater than 1000. As its an integer it will probably be a divide by  zero.

willywortel wrote on Tuesday, February 17, 2009:

I just found out so :slight_smile:

Thank you very much!

raphaelpereira wrote on Tuesday, February 17, 2009:

If you want, use the following macro for a generic greater than 1000 ticks converter:

#define rtos_convert_to_ms(A)  (((A * 1000)/(1000000 / configTICK_RATE_HZ)))