I'm using PPI to trigger a gpio high after a given delay from 4.00 ms to 8.00 ms. I need to be accurate up to .01 ms but i'm seeing some jitter in the actual delay vs given delay. Is there any way I can ensure I can be accurate to .01 ms?
I'm using PPI to trigger a gpio high after a given delay from 4.00 ms to 8.00 ms. I need to be accurate up to .01 ms but i'm seeing some jitter in the actual delay vs given delay. Is there any way I can ensure I can be accurate to .01 ms?
start the HF Crystal oscillator. If you are using internal RC for HFCLK, it will be less accurate. Do this by
NRF_CLOCK->TASKS_HFCLKSTART = 1;
while(0 == NRF_CLOCK->EVENTS_HFCLKSTARTED);
At what point would be best to start this? I am using bluetooth as well. I have the following before i start advertising and start my application loop.
sd_clock_hfclk_is_running(&err_code);
if (!err_code) {
sd_clock_hfclk_request();
}
You can that anytime after enabling softdevice (SD) since you are coordinating well with SD by using its API. remember to release it before going to low power and request again on wakeup else your sleep current will be high.
I managed a way to verify the timer value on my event trigger and those seem to be consistent. That leads me to believe that the jitter is the ppi failing to be accurate in setting the gpio signal to high.