I'm using an NRF52840, SoftDevice s140, FreeRTOS, SDK 15.3.0.
I'm trying to sample my ADC at high speed, >1khz (10-40kHz).
I implemented the logic from the SAADC exaple, using PPI and nrf_drv_timer, and I managed to set the speed of the trigger timer in the range of microseconds.
But with the softdevice enabled, the timing is very inconsistent and inaccurate. I have read a few comments confirming this, but can't figure out what the alternative is.
What options are there for a high speed timer used in conjunction with the softdevice and freeRTOS?
I am not familiar with how you can do it with FreeRTOS, but the implementation in \saadc should be able to run without any issue using normal SDK + SD. You may however increase the NRFX_SAADC_CONFIG_IRQ_PRIORITY priority to to 3 (instead of 6). Just make sure that you don't call any softdevice calls from the saadc_callback() in this case, since it will not be able to do softdevice api calls from this interrupt level, ref: