This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DMA for SPI master

I'm reading AD-converter data usin nRF51822 SPI-Master. BLE-stack is active so I can't use interrupts with SPI. I get data every 2 ms. Sometimes Events are delayed so long that I get erroneous data from AD.

Is there some way to implement DMA for the SPI-Master, maybe using SPI-slave some way?

Juha Okkonen

Parents
  • Hi Audun,

    Could you please elaborate on how to synchronize radio activity with the AD reading to achieve 500Hz reading?

    I'm in the same situation as Juha that the AD interupts every 2/4/8 milliseconds. And unfortunately, the AD conversion data has to be read out before the next interrupt comes.

    Thanks, Bruce

  • No problem. Regarding the missing interrupt, as you say it should be skewed when a lower stack interrupt occurs. How much processing are you doing in the GPIOTE interrupt handler? There is a chance that a lower stack interrupt happens while in the GPIOTE IRQHandler. If you haven't cleared the EVENT register at this time and a new GPIOTE interrupt occurs, that new interrupt will be discarded once the EVENT register is cleared. If you aren't already, try clearing the NRF_GPIOTE->EVENTS_x register as the very first thing you do in the IRQHandler.

Reply
  • No problem. Regarding the missing interrupt, as you say it should be skewed when a lower stack interrupt occurs. How much processing are you doing in the GPIOTE interrupt handler? There is a chance that a lower stack interrupt happens while in the GPIOTE IRQHandler. If you haven't cleared the EVENT register at this time and a new GPIOTE interrupt occurs, that new interrupt will be discarded once the EVENT register is cleared. If you aren't already, try clearing the NRF_GPIOTE->EVENTS_x register as the very first thing you do in the IRQHandler.

Children
No Data
Related