SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By aghaeik96
#196026
Hello,

I am trying to interface the SparkFun 9DoF Razor IMU M0 (SEN-14001) to transmit serial data using a SparkFun Transceiver Breakout - nRF24L01+ (WRL-00705).

Please see the hookup guides for each breakout:

https://learn.sparkfun.com/tutorials/9d ... 1504499288

https://learn.sparkfun.com/tutorials/nr ... 1504499288

For the Razor IMU, the hookup guide briefly mentions that pins 10-13 can be used for SPI communication. Can anyone offer some insight as to what code I need to add to the current Razor IMU default firmware in order to have it transmit serial data over SPI, in an identical manner to the strings it delivers through the onboard USB connection?


I've managed to find some code regarding SPI communication for a much earlier breakout, but I'm not sure if this is in any way applicable to the later Razor M0 IMU I'm working with: https://forum.sparkfun.com/download/file.php?id=254

Thank you,
Kevin
By aghaeik96
#196292
Here's exactly what I'm trying to accomplish and why it has been a challenge so far:

I have a Razor IMU M0. I've been able to interface the sensor as a serial object with MatLab to get some realtime visuals: https://youtu.be/nrYjTBk75wc

I want to make this sensor wireless. The most robust solution seemed to use an SPI compatible transceiver. I have selected the SparkFun Transceiver Breakout - nRF24L01+ for this purpose.

The Razor IMU M0 uses an SAMD21 microcontroller to calculate orientation values and transmit them as serial data. Pins 10-13 of the microcontroller are broken out on the IMU. I want to connect these pins to the nRF24L01+ transceiver breakout to send the same exact serial data I get through the wired connection. In order to receive the serial data, I found another nRF24L01+ based device, the Crazyradio PA USB dongle by BitCraze. As the nRF24L01+ is a transceiver, I want to program the one connected to the IMU to transmit and the USB based device to receive.

The first hurdle I need to overcome is establishing SPI communication between the Razor IMU and the transceiver breakout. I will post some pictures below of what I have established so far. The Razor IMU M0 is connected to the nRF24L01+ transceiver breakout as follows:

SCK ---> Pin 13
MISO ---> Pin 12
MOSI ---> Pin 11
CE ---> Pin 10

How can I proceed with reprogramming the IMU to transmit serial data properly over SPI? Please see the Razor IMU M0 hookup guide for all of the relevant libraries: https://learn.sparkfun.com/tutorials/9d ... 1504499288