I'm still lost apparently.. I get a solid MSB that only changes when I tilt the device, not showing anything that makes sense (45' angle would be the same as a 15', move it and the value jumps again..) At rest it says MSB = 1013 and LSB = 640.. Tilt it and MSB changes to 740, jumps to 1040 and back to 710 and back to 1040, etc...
#include "mbed.h"
SPI spi(p5, p6, p7);
DigitalOut led1(LED1);
DigitalOut SCA_RESET_PIN(p23);
DigitalOut SCA_CSB_PIN(p22);
Serial pc(USBTX, USBRX); // tx, rx
int main() {
spi.format(16, 0);
// spi.frequency(1000000);
pc.baud(921600);
SCA_RESET_PIN = 0;
wait(0.01);
SCA_CSB_PIN = 1;
SCA_RESET_PIN = 1;
wait(2);
int X_MSB;
int X_LSB;
int BYTE;
int Address;
while(1) {
Address = 0x05;
BYTE = Address << 10;
led1 = 1;
SCA_CSB_PIN = 0;
X_MSB = spi.write(BYTE);
SCA_CSB_PIN = 1;
led1 = 0;
// X_MSB = X_MSB << 8;
pc.printf("\033[2J");
pc.printf("X_MSB: %d\r\n",X_MSB);
Address = 0x04;
BYTE = Address << 10;
led1 = 1;
SCA_CSB_PIN = 0;
X_LSB = spi.write(BYTE);
SCA_CSB_PIN = 1;
led1 = 0;
// X_LSB = X_LSB << 8;
pc.printf("X_LSB: %d\r\n",X_LSB);
wait(0.005);
}
}
I found these conversations about it.. It doesn't look like anyone has figured it out... ??
http://forum.sparkfun.com/viewtopic.php?t=19998&highlight=sca3000
http://forum.sparkfun.com/viewtopic.php?t=19132&highlight=sca3000
http://forum.sparkfun.com/viewtopic.php?t=18777&highlight=sca3000
http://forum.sparkfun.com/viewtopic.php?t=14366&highlight=sca3000
http://www.vti.fi/midcom-serveattachmentguid-f8d0194a36326993efdc5211fbef229a/tn55_c-code_example_for_sca3000_rev_0.1.pdf
I'm about to give up... =(
http://www.sparkfun.com/commerce/product_info.php?products_id=8791
http://www.sparkfun.com/datasheets/Sensors/Accelerometer/SCA3000-Manual.pdf
Just got mine from FedEx today... Looks pretty straight forward, anyone have fun with it yet?