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

SPI communication between nRF9160DK and nRF52840DK

Hello,

I want to transfer data from nRF52840DK to nRF9160DK using SPI. I want to use nRF52840DK as master which will transfer the data and nRF9160DK as slave which will receive the data.

I have never worked with nRF52840DK. For SPI master, I tried SPI example on nRF52840DK. When I connect MOSI to MISO, the data is transferred. Now I want to transfer this data to nRF9160DK.

On nRF9160DK, I tried SPI master example to check if it works. Now I want to use nRF91 as SPI slave. So I added spi slave drivers and changed overlay file also. But I am not understanding how to configure spi_config struct for slave.

static const struct spi_config spi_cfg = {
//	.operation = SPI_OP_MODE_SLAVE | SPI_MODE_CPOL | SPI_MODE_CPHA,
        .operation = SPI_OP_MODE_SLAVE,
	.frequency = 4000000,
	//.slave = 1,

};

I am not understanding how to set these parameters to configure spi in slave and receive the data.

I connected both the dks to check if nrf91 can receive the data, but spi_read shows error

Related