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

No slave select on SPIM xfer using PPI and GPIOTE

I have a custom board that has an MPU9250 attached as a SPI device. The MPU can generate data ready interrupts. I have set the MPU to generate data ready 4x per second which is about the slowest it can run.

I am using SDK 12.2.0 and I have modified the GPIOTE example under SDK->perpherals. I have set up a PPI channel to start the SPIM xfer on a LOTOHI event of the interrupt pin. I have a second PPI channel configured to toggle a LED attached to another GPIO port when the SPIM_END event occurs.

I have the PPI configured correctly ASFAIK because my LED is toggling, and I can see the interrupts happening on a scope connected to the input pin.

The SPIM is configured to do mulitple XFERs with no increment. (At this slow rate I can respond to the data fast enough) I have a callback defined that does a LOG_HEXDUMP of my rx_buffer and it reads all FFs for the first three transfers and then all 00s thereafter. When I connect a scope to the SPIM pins, my slave select never goes low on the xfers, but the clock is active. Thoughts as to what I'm missing?

I've attached my main.c where everything happens for the sake of this example.

main.c

Related