- Tue Feb 21, 2012 7:01 am
#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:
My 3rd question is: How to turn on the sensor so that it is functioning? Currently I'm doing like below:
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
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
Since I had ground the ALT ADDRESS/SDO into ground, so I had select 0xA6 for write () and 0xA7 read ().call I2CPacket.write(I2C_START | I2C_STOP, 0xA6, 2, send_data_pointer);
call I2CPacket.read(I2C_START | I2C_STOP, 0xA7, 2, send_data_pointer);
My 3rd question is: How to turn on the sensor so that it is functioning? Currently I'm doing like below:
Code: Select all
My 4th question is:databuf[0] = ADXL345_POWER_CTL;
databuf[1] = ADXL345_MEASURE_MODE;
call I2CPacket.write((I2C_START | I2C_STOP), 0xA6, 2, databuf);
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