This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SPI with chip select using GPIO in SDK V11.0 not working

Hi,

I am trying to use SPI to get data from a sensor. In nRF 5 SDK V11, I got it to work by setting the SS pin in the config struct of the initialization function.

image description

Now, instead of declaring the chip select in the config structure, I want to use a GPIO pin to achieve the same. I think I am configuring everything correctly but I am not reading the right values. I am getting some garbage values. Here's my main file

image description

SPI initialization function now looks like this

image description

The bmaInit() function involves writing data through SPI and so I pulled it low and back high.

Should be pretty straightforward but I can't seem to get it to work. I read different garbage values in every loop. Am I missing something? I feel there's a problem with timing or with reading the buffers. Appreciate any help! Thanks.

Parents
  • Which DK are you using, 51 or 52? Are you using non-blocking spi and do you wait for the transaction to finish before you pull the CS line high? You may want to connect an oscilloscope or logic analyzer to the lines to see what actually happens.

Reply
  • Which DK are you using, 51 or 52? Are you using non-blocking spi and do you wait for the transaction to finish before you pull the CS line high? You may want to connect an oscilloscope or logic analyzer to the lines to see what actually happens.

Children
No Data
Related