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

SPI communication between nRF51422 and Arduino

I want to set up an SPI communication between nRF51422 SOC (integrated on nRF51 DK) and Arduino board. I know that it is possible since I've read it in various posts and nRF51 reference manual. But, I couldn't find a working example for it (SPI) in the nRF51 SDK, as is given for UART communication.

I have read the SPI master loopback example and the SPI slave example, provided with the SDK, but I couldn't comprehend whether they could be used for TX or RX from nRF51's side. If they can be, then how?

For the SPI TX/RX from the Arduino's side, I've read the Arduino SPI Library and trying to implement it, in a similar manner as this (www.arduino.cc/en/Tutorial/SPITransaction). Does it look fine? If not, then what should be used instead?

Parents
  • You can take a look at the SPI example where the nRF51 is the SPI slave and the Arduino is the SPI master. This is a 5 wire SPI interface (MISO, MOSI, SCK, REQN and RDYN) The code for this is part of the https://github.com/NordicSemiconductor/nRF51-ble-bcast-mesh

    The Arduino SPI master code is available in "application_controller/serial_interface" folder. The readme for this folder has additional documentation links.

    The nRF51 SPI slave code is present in the "rbc_mesh/src/serial_handler.c" , this should provide you with a working example.

  • Thanks David for the link. It is pretty much what I was expecting. Follow-up: The example that you provided above would help me setting up a mesh-connection using "Bluetooth". I want to connect 8 to 12 devices in my network. Is it possible to achieve so using the Bluetooth SoftDevice? Also, does that example provide peer-to-peer support among all the nodes, or would I have to set up a "master" to control the entire mesh-connection? If it is not possible to connect 8 to 12 devices using "Bluetooth", can that example be used (with some modifications) to set up the mesh-connection using "ANT+"? If so, kindly explain the modifications to be done to the above example, as I'm a newbie. I've read that ANT can support upto 8 connection channels simultaneously, where each channel can support upto 65533 nodes. So, it would be possible to add more devices to my network in the future, using ANT.

Reply
  • Thanks David for the link. It is pretty much what I was expecting. Follow-up: The example that you provided above would help me setting up a mesh-connection using "Bluetooth". I want to connect 8 to 12 devices in my network. Is it possible to achieve so using the Bluetooth SoftDevice? Also, does that example provide peer-to-peer support among all the nodes, or would I have to set up a "master" to control the entire mesh-connection? If it is not possible to connect 8 to 12 devices using "Bluetooth", can that example be used (with some modifications) to set up the mesh-connection using "ANT+"? If so, kindly explain the modifications to be done to the above example, as I'm a newbie. I've read that ANT can support upto 8 connection channels simultaneously, where each channel can support upto 65533 nodes. So, it would be possible to add more devices to my network in the future, using ANT.

Children
No Data
Related