nrf52832 SPIM Driver "Missing" MISO Bits

Hi All,

I am running into an issue where the data returned from nrfx_spim_xfer() does not match what is being transmitted on the line. More details below.

MCU: nrf52832
SDK: nRF5 17.1.0

IDE: Segger 5.70a

Here is an example of the issue. When trying to read a register of an AFE using SPI, we can see this data being transmitted using a logic analyzer:

As shown in the scope screenshot, it would appear that the data on the MISO line (green plot in picture), would represent a value of 0xFF then 0x89. In the debugger, the data that appears in the rx_buffer appears as so:

This issue occurs on several different occasions, where 1 or 2 HIGH bits appear to be missed. 

Below are the SPI init settings being used:

SPI Mode 0 was confirmed to us by the AFE manufacturer to be the correct SPI mode for the device. Let me know if any other information would be helpful, thanks!

  • Hi, I should have clarified more. In the code samples I posted in the comments, I had currently been using SPI MODE 3. The pictures taken in the original post were using MODE 0. We have been going back and forth with the manufacturer of the AFE for some time now, their documentation and reps have been giving us incorrect information. We currently believe that SPI MODE 3 is the correct mode to use with their chip. Since switching to MODE 3, we have not seen the missing bits issue, which is good. I would still be concerned about the missing bits when using SPI MODE 0 though, because even if it's the wrong mode, the micro should still be reading the signal shown on the scope correctly, which it was not.

    I did try the manual pin configurations to increase the drive strength and that did not seem to have an impact on performance. 

Related