Pages: [1]   Go Down
Author Topic: ADXL345 Accelerometer on Arduino Due using SPI  (Read 799 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is a very basic issue, and I'm not sure how to deal with it. Using the tutorials posted on sparkfun (https://www.sparkfun.com/tutorials/240) I have been able to get a continuous stream of what seems to be accurate data on an Arduino Uno (at least the numbers change when I move the accelerometer around) However, switching the exact same setup onto a Due seems to break it. All I receive is a series of -1,-1,-1. I think I have narrowed the problem down to the fact that the SPI pins are different on a Due, but other than the SPI male header pins, I don't know the location of any female ones. Nor do I know how to initialize the program to accept a different digital pin as the source of data. Might anyone be able to suggest a fix? Thank you
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My apologies for placing this in the wrong subforum
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am bumping this topic in the hopes that there is at least one reply saying anything, but if this is a silly problem, could anyone post the location of female SPI pins on the Due? None of the sites I visit seem to indicate there are any. Thank you in advance
Logged

Offline Offline
God Member
*****
Karma: 32
Posts: 507
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In theory, it is possible to get the Serial and Serial2 pins working in SPI mode, but nobody has written a library to do this yet.

There are no female SPI connections which work with the current hardware SPI library on the Due. The only way is to use the male SPI pins - use connectors like these: https://www.sparkfun.com/products/9385 - don't use croc clips or similar because it's too easy to accidentally touch against the 5v pin and damage the SAM3X.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you so much, that was just the definitive answer I was looking for, oh well, I'll look into I2C then! Thank you again!
Logged

Pages: [1]   Go Up
Jump to: