2024-01-03 06:02 AM
I m using FreeRTOS functions and discovered that the osDelay could only works on mini second, anyway to perform at micro second and nano second delay? If i create a micro second delay using timer TIM1 will that satisfy real-time prerequisite? Anyone can advise?
2024-01-03 06:31 AM
You're not going to be able to interrupt at these high rates.
Take a 32-bit TIM, say TIM2 or TIM5, program it in maximal mode, and a prescaler of 0 (DIV1), and then use TIMx->CNT to observe time counting off.
Get an initial value, and subtract if off the current value, and wait for it to count off the precribed number of ticks for the rate it is counting at.
It's going to count in multiple nano-seconds, and if the MCU goes off to service an interrupt it might be off doing that for a few micro-seconds.