SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By strewberry88
#140117
Hi All,

I'm a student currently working on a project which is using ADXL345. I had solder my sensor by following the datasheet (It is interface by using I2C) with 1k ohm for the pull-up resistor and 3V power supply.

It is attached to MicaZ (Mib510 + MPR2400 as its processor) and working under TinyOS (Window XP platform).

My 1st question is: 1k ohm for pull-up resistor, is it correct for power supply up to 2.8 ~ 3V ?

My 2nd question is: How I know that I am write() and read() correctly? It is because, after loading the program into the MicaZ, and start communicating with the Base Station by using wireless connection, no output I had received and both Micaz and Base Station is not communicating with each other (their LED light is not blinking). my write and read functions are listed at below:
Code: Select all
call I2CPacket.write(I2C_START | I2C_STOP, 0xA6, 2, send_data_pointer);
call I2CPacket.read(I2C_START | I2C_STOP, 0xA7, 2, send_data_pointer);
Since I had ground the ALT ADDRESS/SDO into ground, so I had select 0xA6 for write () and 0xA7 read ().

My 3rd question is: How to turn on the sensor so that it is functioning? Currently I'm doing like below:
Code: Select all
databuf[0] = ADXL345_POWER_CTL;
databuf[1] = ADXL345_MEASURE_MODE;
call I2CPacket.write((I2C_START | I2C_STOP), 0xA6, 2, databuf); 
My 4th question is:
Is there any code available for my project so that I can refer to it? It is because I am running out of time. Currently I was studying the code from
https://github.com/tp-freeforall/prod/t ... SimpleADXL for 2 weeks also can't get my code running correctly.

Thanks and hope get some advice from you all.

Best Regards,
Strewberry
By strewberry88
#190825
UhClem wrote:http://code.google.com/p/tinyos-main/so ... 45/?r=5443
Hi,

Thank. It has moved to https://github.com/tinyos/tinyos-main/t ... ps/adxl345

I'm currently using TinyOS in Xubuntu now. Last time it went success with WindowOS platform but now in Xubuntos, it failed again.

It get "EOFF" returned for I2CPacket.readDone().

I was using the updated version of Atm123:
https://github.com/tinyos/tinyos-main/b ... PacketP.nc