SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By annacegu
#97985
Hi,
I have an ADXL345 breakout board, and I'm trying out the self test feature as shown in the application section of the datasheet (pp 20-21). However, I am getting a value out of range in the z axis (-212 LSB where it's expecting a range of 75-875 LSB).

Would anyone know what I would need to do to fix this?

Regards,
Anna.
By ryowens84
#98001
Hello,

Have you verified that you can read the DEVID register to validate your SPI command protocol? Also have you checked to make sure that the resolution, range and bandwidth rate are set appropriately for the self test?

-Ryan
By waltr
#98005
-212 LSB where it's expecting a range of 75-875 LSB
Are these values converted to decimal?
What is the raw binary value read?
By annacegu
#98065
ryowens84 wrote:Hello,

Have you verified that you can read the DEVID register to validate your SPI command protocol? Also have you checked to make sure that the resolution, range and bandwidth rate are set appropriately for the self test?

-Ryan
Hi,

Thanks for your reply. I'm using I2C. I'm picking up the DEVID register as 0xE5, and I set the following registers in this order:
POWER_CTL = 0x00
BW_RATE = 0x0E
DATA_FORMAT = 0x0B or 0x0x8B depending on self-test mode
INT_ENABLE = 0x80
FIFO_CTL = 0x9F
POWER_CTL = 0x2D

I initialise the accelerometer twice - once for self-test readings (st_on) then for normal readings (st_off), then I take the difference between st_on & st_off to get the self-test value.

Regards,
Anna.
By annacegu
#98067
waltr wrote:
-212 LSB where it's expecting a range of 75-875 LSB
Are these values converted to decimal?
What is the raw binary value read?
Hi,

Thanks for your reply. In the process of answering your question, I just realised that my summations were overflowing. I have fixed it, and all 3 axes are now within range during self-test.

Regards,
Anna.