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

Chip select to high when send data to a external SPI memory

Hello everyone, the sdk version that I use is 15.0.

I'm trying to connect my nRF52832 (master) to an external SPI slave memory (N25Q) to write and read data.
The problem is that to write you have to send a command and then put the chip select signal to high as you can see in the following image:

In the example of peripheral/spi the chip select signal is the blue one, the yellow is the clock:

Is there any way to be able to control the chip signal select at the moment when data is being sent by spi? For example, after sending the first byte, like in the following image:

Another alternative would be to create the signals (SCLK,CS,MOSI,MISO) from scratch.Is there an example that I can use as a template?

Thanks

  • Hi christoff,

    I think you're mixing some things of the SPI protocol up. The chip select is usually high (1) when the slave is inactive, and low (0) when you're talking with the slave (called active low). Regardless of which way around this is, you have to have the chip select in active state when you're communicating with the slave during both command byte and regular communication. I have taken a look at the datasheet of this chipset at page 12.

    There are some examples that handle SPI including the chip select for you.

    SPI master example

    nrfx SPI master example

    SPI slave example

    Kevin

  • Check spi_mngr example. It gives you 2 callbacks, before and after msg is sent. You can use them to drive CS pin.