2015-10-06 02:28 AM
Hello there,
I am using HAL library with FreeRTOS middleware. The minimum delay I can use for the osDelay() function seems to be 1 ms. I would like to turn on task periodically every 10 or 100 ns. Is that even possible? I would apreciate all help.2015-10-06 04:54 AM
You should use one of the general purpose timers for that task. It will generate an interrupt every X ns, you then do what you want in the interrupt handler but you must be fast enough to complete your task in less than X ns.
2015-10-06 04:59 AM
Yes I understand the concept. The systick timer is responsible for the bit ticking of osDelay. But even though I change its timebase:
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/100);
The framework manages and adjusts, as the osDelay takes ms not ns and is recalculated. Thats why I am wondering either there is a way around it?
2015-10-06 05:06 AM
FreeRTOS requires your SysTick to be exactly 1ms to work correctly. Just use another timer, leave the SysTick timer to the OS.
2015-10-06 05:41 AM
I understand, thank you.