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
  • It is certainly possible, but you will need to determine who is the "mastermind" in your system. Is the nRF51 pulling data from the Arduino or vise versa, i.e. which is the master and which is the slave? We have both master and slave drivers in our SDKs and there is some documentation of the functionality here: master & slave (it is somewhat complicated i know). How these drivers and the nRF51 will interact with your Arduino is highly dependent on your particular application.

    Are you communicating with a regular Arduino controller or are you using a shield with specific sensors on it? Specific sensors usually have a datasheet describing the communication protocol. If you are just communicating with a regular Arduino I guess you will have to come up with a protocol yourself (or get inspiration from the google).

Reply
  • It is certainly possible, but you will need to determine who is the "mastermind" in your system. Is the nRF51 pulling data from the Arduino or vise versa, i.e. which is the master and which is the slave? We have both master and slave drivers in our SDKs and there is some documentation of the functionality here: master & slave (it is somewhat complicated i know). How these drivers and the nRF51 will interact with your Arduino is highly dependent on your particular application.

    Are you communicating with a regular Arduino controller or are you using a shield with specific sensors on it? Specific sensors usually have a datasheet describing the communication protocol. If you are just communicating with a regular Arduino I guess you will have to come up with a protocol yourself (or get inspiration from the google).

Children
No Data
Related