BLE radio interrupts interfering with SPI

I make a BLE/USB MIDI controller that has an NRF52840 receiving sensor data by SPI from an Atmega 32u4 at 2Mhz. The NRF52840 is the SPI master (SPIM3). When I'm using BLE and sending a lot of MIDI messages, an SPI transfer occasionally gets corrupted. I'm using the Arduino environment so I'm not sure if this is the correct place to ask this, but I'm curious if this is more likely to be a hardware issue or some fragility with my SPI protocol. The two microcontrollers are within a few centimeters of each other. I don't have series resisters on MOSO or MISO, and I don't have an external pullup on SS.

If it's a software issue rather than hardware, what are possible reasons why a radio interrupt would affect SPI?

I have also tried switching to SPIM2, and the results are the same, so I don't think is related to anomaly 198.

Parents Reply
  • For best performance maybe try SPIM1, since SPIM1 eclipses the RADIO, UART and SAADC:

    // Bus master nRF52840
    // =======================
    // CPU
    // CTRL-AP
    // USB
    // CRYPTOCELL
    // SPIM1/SPIS1/TWIM1/TWIS1  Same priority and mutually exclusive
    // RADIO
    // CCM/ECB/AAR              Same priority and mutually exclusive
    // SAADC
    // UARTE0
    // SPIM0/SPIS0/TWIM0/TWIS0  Same priority and mutually exclusive
    // SPIM2/SPIS2              Same priority and mutually exclusive
    // NFCT
    // I2S
    // PDM
    // PWM0
    // PWM1
    // PWM2
    // QSPI
    // PWM3
    // UARTE1
    // SPIM3
    

Children
No Data
Related