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

SPI Signals pinout

Hi.

I would like to route the BLE SPI signals to an external connector for use with external debugger.

Please specify which the nRf52832 pins are by default assigns to these signals:

1) SPI_MOSI(SDI)

2) SPI_MISO(SDO)

3) SPI_CLK

4) SWDIO

If I missed another signal please add

Thanks

Parents
  • Hello.

    You can connect to any GPIO pin found in this table in the product specification for the SPI signals. The SWDIO pin is also found in this table. 

    The mapping of the pins needs to be done according the configurations found for each signal, which is also found in the product specification for the SPI here, I suggest you read that.

    - Andreas

  • Hi

    Thanks for your answer

    Can you specify how can I map the spi interrupt pin in the software?

    Thanks

  • Hi again.

    Here is an example:

    Open up the main.c file in your SDK 15 folder, nRF5_SDK_15.0.0_a53641a\examples\peripheral\spi\main.c

    Under the main function you find the struct spi_config that defines which GPIO pins the SPI is configured to.

    The struct is the following code:

        nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
        spi_config.ss_pin   = SPI_SS_PIN;
        spi_config.miso_pin = SPI_MISO_PIN;
        spi_config.mosi_pin = SPI_MOSI_PIN;
        spi_config.sck_pin  = SPI_SCK_PIN;
        APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL));

    Just change SPI_SS_PIN, SPI_MISO_PIN, SPI_MOSI_PIN, and SPI_SCK_PIN to the GPIO pins integers you found in the pin assignment.

    You can also open one of the project files found in nRF5_SDK_15.0.0_a53641a\examples\peripheral\spi\pca10040\blank and do the exact same thing.

    - Andreas

Reply
  • Hi again.

    Here is an example:

    Open up the main.c file in your SDK 15 folder, nRF5_SDK_15.0.0_a53641a\examples\peripheral\spi\main.c

    Under the main function you find the struct spi_config that defines which GPIO pins the SPI is configured to.

    The struct is the following code:

        nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;
        spi_config.ss_pin   = SPI_SS_PIN;
        spi_config.miso_pin = SPI_MISO_PIN;
        spi_config.mosi_pin = SPI_MOSI_PIN;
        spi_config.sck_pin  = SPI_SCK_PIN;
        APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL));

    Just change SPI_SS_PIN, SPI_MISO_PIN, SPI_MOSI_PIN, and SPI_SCK_PIN to the GPIO pins integers you found in the pin assignment.

    You can also open one of the project files found in nRF5_SDK_15.0.0_a53641a\examples\peripheral\spi\pca10040\blank and do the exact same thing.

    - Andreas

Children
No Data
Related