gpiote input realtime event handler is interrupted by BLE operation in the softdevice

I am using the softdevice from SDK 17.0.2 for bluetooth communication in my nRF52840 instrument application. I am using a gpiote event handler to acquire 8192 readings from an ADC interrupting the gpiote every 31.25 uS (32 KHz). My ISR reads the 32 bit ADC data via the SPI peripheral every interrupt and stores the 32 bit data in a buffer. I need to acquire every ADC reading to get accurate results for an RMS measurement. It seems there are about 3 gaps in the acquired data where the response to the gpiote interrupt is delayed for about 60 or more uS. This delay causes me to miss one or sometimes 2 ADC readings because the ADC times the operation and it overwrites the realtime data if it is not shifted out of the ADC in a timely manner (within 31uS). The entire acquisition process takes 256 milliseconds.

I experimented not enabling the BLE operation of the softdevice and I had no gaps in my data. This does indicate that the BLE - softdevice operation is interrupting my acquisition process.

I tried giving the gpiote event a higher interrupt priority I believe it was 4 instead of 6. This caused my application to not even start up. Do you have suggestions on how I can deal with this issue?

Can the softdevice be temporarily suspended while I do this acquisition?

It was suggested that I may be able to use PPI (Programmable peripheral interconnect) to deal with this. If this is possible can you tell me how to use a PPI event to execute a task of executing a 32 bit SPI read and then storing the data in a buffer?

Are there any other suggestions you can offer?

Parents Reply Children
No Data
Related