Hi
I use the nRF51 Development Kit and the pin_change_int example.
when i push the button the LED changes but there is a delay of 16us.
is this normal ? can i speed this up ?
Blue is the Button Signal
Red is the LED signal
Hi
I use the nRF51 Development Kit and the pin_change_int example.
when i push the button the LED changes but there is a delay of 16us.
is this normal ? can i speed this up ?
Blue is the Button Signal
Red is the LED signal
Hi,
The interrupt latency for the Cortex M0 is 16 cycles == 1 us @ 16M.
The remainder of the time is processing in the nrf_drv_gpiote library (interrupt handler), as this library handles both PORT and IN[n] events. The PORT event uses the SENSE functionality, which is a level trigged signal, not a edge-trigged signal. In order to detect toggle operations, you emulate edge-triggering by inverting the SENSE (going from HIGH to LOW polarity), which may account for the processing time.
You can switch to use the IN[n] events by setting "high accuracy" when configuring your pin, which shall decrease processing time needed: GPIOTE_CONFIG_IN_SENSE_TOGGLE(true)
GPIOTE IN[n] usage does use more current than the PORT event.
If this is too much of a jitter, I'd recommend that you implement GPIOTE PORT directly, like done here: https://github.com/NordicPlayground/nrf51-powerdown-examples/blob/master/system_on_wakeup_on_gpio/main.c
Best regards,
Håkon
Hi,
The interrupt latency for the Cortex M0 is 16 cycles == 1 us @ 16M.
The remainder of the time is processing in the nrf_drv_gpiote library (interrupt handler), as this library handles both PORT and IN[n] events. The PORT event uses the SENSE functionality, which is a level trigged signal, not a edge-trigged signal. In order to detect toggle operations, you emulate edge-triggering by inverting the SENSE (going from HIGH to LOW polarity), which may account for the processing time.
You can switch to use the IN[n] events by setting "high accuracy" when configuring your pin, which shall decrease processing time needed: GPIOTE_CONFIG_IN_SENSE_TOGGLE(true)
GPIOTE IN[n] usage does use more current than the PORT event.
If this is too much of a jitter, I'd recommend that you implement GPIOTE PORT directly, like done here: https://github.com/NordicPlayground/nrf51-powerdown-examples/blob/master/system_on_wakeup_on_gpio/main.c
Best regards,
Håkon