Samd21, ADXL345 and SPI

For the discussion of Arduino related topics.

Moderator: phalanx

Post Reply
erickinne
Posts: 1
Joined: Sun Dec 31, 2017 5:25 pm

Samd21, ADXL345 and SPI

Post by erickinne » Sun Dec 31, 2017 6:29 pm

I've been fussing with getting the ADXL345 (https://www.sparkfun.com/products/9836) and the SAMD21 Mini (https://www.sparkfun.com/products/13664) trying to get them to talk. I'm using the example code from the ADXL345 Hookup Guide as well as hooking up the ADXL345 to the SAMD21 as directed for SPI connections. I've gone in and commented out most of the code to try and find what lines are causing the trouble and it seems as though the following line near the top is:

ADXL345 adxl = ADXL345(10); // USE FOR SPI COMMUNICATION, ADXL345(CS_PIN);

I'm not super experienced in troubleshooting hardware code beyond trying to print out lines as you go through the code, but I can't even get to far in the code and I don't see any errors in the arduino IDE.

Can anyone help?

Thanks!

lyndon
Support Volunteer
Posts: 1588
Joined: Thu Jul 17, 2008 6:37 pm
Location: Minnesota, USA

Re: Samd21, ADXL345 and SPI

Post by lyndon » Tue Jan 02, 2018 12:06 pm

The SPI drivers on the Cortex MCUs uses different code than SPI on the Arduino Uno. Be sure you have the right version.

Post Reply