k_sleep in microseconds duration is not precise

Hello,

We are triggering a pin for 50 microseconds but the actual time the pin is triggered as measured with an oscilloscope seems to vary around 150microseconds.


This is quite a difference. Is there anything we need to set for higher accuracy?

Code:

    nrf_gpio_pin_write(trigger, 1);
    k_sleep(K_USEC(50));
    nrf_gpio_pin_write(trigger, 0);



Thanks,
Geo

Parents Reply Children
Related