rtel wrote on Friday, December 28, 2012:
1. I’m running on STM32 with 120MHz CPU clock what is acceptable range of configTICK_RATE_HZ for this case. I mean what is the max rate what will keep OS run time relatively small compared to processes run time.
Most applications use a tick of 10 to 100ms. I would not recommend going faster than 1ms.
2. What is an average process switch time? Based on this parameter I can answer question 1 as well.
You have the hardware and compiler with your compiler settings in front of you so I suggest you just measure it. All context switches are performed by the PendSV handler, so you can time how long that takes to execute. If you are using FreeRTOS V7.3.0 then you can also define configUSE_PORT_OPTIMISED_TASK_SELECTION to 1 to save a few extra cycles at the cost of being limited to 32 different priority levels.
3. I have an alphanumeric LCD on board and it’s working fine. But this type of LCD requires delays of about 100us after each character write. Currently I run with configTICK_RATE_HZ = 1000 and to implement 100us delay I busy loop.
Do you have any suggestion on implementing sub TICK_RATE_HZ delays better then loop?
If it is a small display that only holds a few characters you might be better off just using a delay of 1ms as it won’t be noticeable. If you have a large display, or are scrolling characters then the additional time would be noticeable.