sparkfun / 9DOF_Razor_IMU

9DOF Razor IMU available from SparkFun Electronics
Other
114 stars 94 forks source link

SPI pins of Razor imu m0 #14

Closed theekshanadis closed 6 years ago

theekshanadis commented 6 years ago

Hi, Anyone know the correct SPI pinouts of the razor imu mo. In the website they said that 10-13 can be used for SPI communication. Can anyone explain it further. What are the mappings of MISO, MOSI, SCK, and SS to those pins (what is the order.....) Thank you.

bboyho commented 6 years ago

Hi,

It looks like most of those pins are defined in these files:

https://github.com/sparkfun/Arduino_Boards/blob/master/sparkfun/samd/variants/SparkFun_9DoF_M0/variant.cpp#L58

,

https://github.com/sparkfun/Arduino_Boards/blob/master/sparkfun/samd/variants/SparkFun_9DoF_M0/variant.h#L130

, and

https://github.com/sparkfun/9DOF_Razor_IMU/blob/2865253ffa7e31ac77c2e741931da7af4e8779a4/Firmware/_9DoF_Razor_M0_Firmware/config.h

Looking at the Eagle files, the pins are not broken out to a through hole by default. However, it is connected to the microSD card socket.

You should be able to create a new instance by assigning pins 10-13 to SPI. I have not tested this out before so I do not know the exact details of how to do this. While this was written for making another UART instance on the MKR1000, this may give you some insight in how to do this for SPI on the 9DoF => https://www.arduino.cc/en/Tutorial/SamdSercom ]. Also, try looking at this Arduino.cc Forum post for an idea => [ https://forum.arduino.cc/index.php?topic=500381.msg3413461#msg3413461 ].