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

nRF52832 SPIM + ESB Signal Noise?

Bear with me, this might be complicated. I'm currently transmitting some audio data via ESB. The data gets passed as followed:

Microphone (PDM) -> nRF52 (1) (SPIM) -> nRF52 (2) (SPIS/ESB1)    

gets sent to

nRF52 (3) (SPIM/ESB2) -> nRF52 (4) (SPIS/I2S) -> DAC (I2S) -> Amplifier (Analog) -> Speaker

The issue I'm having is I'm getting a distorted audio output that appears to be at some harmonic of 200Hz.  If I send the data directly from nRF52 (2) to nRF52 (4) via ESB and bypassing the SPI transfer the audio is not distorted.  When I include that final SPIM -> SPIS transfer the audio IS distorted.  Still with me?

Due to the layout of the board, it's necessary to receive the ESB with nRF52 (3) as nRF52 (4) is in the center of the board and it's RF is horrible.

At this point I'm at a loss as to the cause.  The SPIM -> SPIS code for nRF52 (1) -> nRF52 (2) is the same as nRF52 (3) -> nRF52 (4).  The only thing I can imagine thats different is that the SPIM and ESB are both enabled in nRF52(3), which might be causing some sort of conflict? Maybe the clocks?

Other information that might be useful:

1. SPIM Clock has been tested at 4MHz and 2MHz, no change.

2. ESB has been tested at 2MBit/s and 1MBit/s, no change.

3. I am sending 248 bytes via ESB every 5ms (200Hz).

4. I am sending 248 bytes via SPI every time an ESB transaction is successful.

5. Connectivity does not appear to be an issue, the data coming across the RF is correct with next to no drops, retransmits are limited to 1.

6. Noise in the amplifier does not appear to be an issue.

Any ideas? I'd be happy to provide any other information.

Related