Hi,
then i am starting the timer with configuration :
Hi,
then i am starting the timer with configuration :
The resolution of the kernel timers depend on which clock you are using. We are using RTC on nRF and the configuration CONFIG_SYS_CLOCK_TICKS_PER_SEC is set to 32768 in our samples.
You should not use k_timer for creating timeouts less than the resolution of the system timer.
Thanks
Thanks
MaximSh said:So how to run polling of some code every 500 microseconds without using timer?
Not sure if I understand this right, you want to have a time waiting code that waits for 500uS without using any timer? I am guessing that you want to use Kernel API for that instead of directly using timer API.
In that case you can only sleep with a resolution of the timer tick(SYS_CLOCK_TICKS_PER_SEC default value is 32768 on RTC) . If you want any better resolution, then you need to use high resolution timer API like nrfx_timer or nrfx_systick. The disadvantage of using high resolution timers is that they keep the high frequency clock on all the time and hence increasing the average power consumption of your application. If your application is running on a battery, it will be drained within days (if not hours)