Chip Select(CS PIN) control manually

Hello

We are using NRF SDK nRF5_SDK_17.0.2 and Softdevice s140_nrf52_7.2.0_softdevice in my Code.

We are using SPI Interface for transferring data to the SPI based External flash.

Here We want to controlling the Chip Select Pin of the SPI Interface manually.

So how we can do that?Any standard Steps for do that?

Parents
  • Hello,

    As a start check out: \examples\peripheral\spi\main.c

    In your case you should set spi_config.ss_pin = NRFX_SPIM_PIN_NOT_USED;

    Then before calling nrf_drv_spi_transfer() you can call nrf_gpio_pin_clear(), and in spi_event_handler() you can call nrf_gpio_pin_set(). Then you can control the slave select pin (chip select pin) before and after calling nrf_drv_spi_transfer().

    Kenneth

Reply
  • Hello,

    As a start check out: \examples\peripheral\spi\main.c

    In your case you should set spi_config.ss_pin = NRFX_SPIM_PIN_NOT_USED;

    Then before calling nrf_drv_spi_transfer() you can call nrf_gpio_pin_clear(), and in spi_event_handler() you can call nrf_gpio_pin_set(). Then you can control the slave select pin (chip select pin) before and after calling nrf_drv_spi_transfer().

    Kenneth

Children
No Data
Related