nrf5340 interrupt speed

Hello,

I have a project sampling a ADC. It has a INT output signaling new data is ready to be read with max sampling rate of 125ksps. I am using the interrupt and then reading the data through SPI. I noticed the interrupt triggers late so I used your nrf DevAcademy interrupt example (Lesson 2 exercise 2) where you toggle a LED when pressing the button on the DK. With an oscilloscope the LED toggled ~6.3us after the GPIO triggers


Is it possible to get this delay down to 1-2us? As I need to read 10bytes at 16MHz SPI clock which takes 5us and being 8us in between samples means that 6us delay overlaps with the next interrupt happening.

Best regards,

Domen

Using:
-nrf5340dk
-nrf sdk v2.6.1

Parents
  • No possible with an interrupt handler function AFAIK.

    But the NRF5340 supports DPPI, which you could use to trigger TASKS_START in the SPIM perihperial directly from the GPIOTE peripherial IN event. Then you can either try to re-feed in the EVENTS_STARTED interrupt handler - that is the earlies time you can write the next buffer location into the SPIM registers while a transfer is running. Or you can try using the EasyDMA List feature.

     No idea if that was supported in the zephyr SPI driver at all - you will likely need to use registers directly.

Reply
  • No possible with an interrupt handler function AFAIK.

    But the NRF5340 supports DPPI, which you could use to trigger TASKS_START in the SPIM perihperial directly from the GPIOTE peripherial IN event. Then you can either try to re-feed in the EVENTS_STARTED interrupt handler - that is the earlies time you can write the next buffer location into the SPIM registers while a transfer is running. Or you can try using the EasyDMA List feature.

     No idea if that was supported in the zephyr SPI driver at all - you will likely need to use registers directly.

Children
Related