I have quite a few SPI peripherals to be interfaced with nrf52840 chip, for example, Ethernet plug, ATWINC1500 WIFI module etc. What example should i start with to get an idea of the SPI works with nrf52840? I am using sdk15.0.0
Thanks!
I have quite a few SPI peripherals to be interfaced with nrf52840 chip, for example, Ethernet plug, ATWINC1500 WIFI module etc. What example should i start with to get an idea of the SPI works with nrf52840? I am using sdk15.0.0
Thanks!
Hi,
I would recommend that you start with the SPI examples. This example use the SPI master driver directly, and it is quite easy to understand how things work.
The SPI manager example use the SPI manager library, which have a higher abstraction layer on top of the SPI driver. This is useful for handling SPI transactions to multiple SPI slaves, with different configurations (pin, frequency, mode, etc.), but understanding exactly how the example works is a bit more difficult.
If you start with the SPI example first and make this work with a single SPI slave, you can always move to SPI manager after a while if you need to interface multiple devices.
Best regards,
Jørgen
Thanks Jorgen, I do need to interface multiple slaves and switch between them using slave select. How many slave masters can I use on the nrf52840 chip? Is there any preference of what pins to be used as SPI peripherals. I have in all 6 SPI peripherals to be interfaced with nrf52840. Thanks, I would definitely start with SPI example to understand the working of SPI.
You are only limited by the number of GPIOs used for CS lines and the time available in the CPU to interface the SPI slaves. The nRF52840 have 48 GPIOs, meaning you can interface up to 45 SPI slaves. Note that you can only interface one SPI device at a time with a single SPI interface. If you need to interface multiple SPI slaves simultaneously, the nRF52840 support up to 4 SPI master instances.