AnsweredAssumed Answered

ADXL345 activity & inactivity issue - detection on all axes not working

Question asked by pentelone on Dec 31, 2014
Latest reply on Jan 3, 2015 by neilzhao


on the begining i want to give my regards to AD engineers meet at Electronica 2014, hope some of you guys reading this forum:)


I'm experiencing issues with ADXL345 specifficaly with activity and inactivity function. I've setup properly - i hope, and i notice that inactivity and activity function is not working properly when all axis (xyz) are participating in detection. Thresh registers for inactivity and activity are set for 0x02 and 0x04 and inact time register is set to 0x02 - and function desn't work - i only got activity interupt once. When i moved both activ and inactiv threshold to 0x09 and 0x12 it works quite ok, but big force must be used to wake accelerometer up. BUT! when i setup only X axis to participate in activity and inactivity detection and decrease their thresholds 0x04 0x02 respectively, function works properly and adxl345 go sleep ("go home";)).   I thougth that noise on all axis is really big, but i can see maximum change of 5 lsb, when not moving adxl345. I hope you can help me to face this problem. Here is my config, maybe i missed sth. Created functions verify stored value in registers by reading them after value is sent so i think that we can skip problem with uC.


EDIT: I noticed one more thing, ADXL345 form time to time set int_source register as 0111 0001 so it means single tap, double tap and activity interrupt were detected. So to test it i disable the single and double tap and left only data ready inactiv and activ interrupt. Problem still exist. And it's really strange. Should i  start thinking that adxl345 is broken?


ADXL345_READ(ADXL345_DEVID_REG ,&flush);

    if (flush&&0xE5){


    ADXL345_WRITE_AND_VERIFY(ADXL345_INT_ENABLE_REG  ,0x00);// go home

    ADXL345_WRITE_AND_VERIFY(FIFO_CTL,0x00);     // turn off fifo

    ADXL345_WRITE_AND_VERIFY(BW_RATE, 0x0B);     // set rate

    ADXL345_WRITE_AND_VERIFY(DATA_FORMAT, 0x08);// set data format


    //////////////////// tap config////







    ////////////////// inactivity & activity set //////





    ////////////////// FIFO /////////////////////////

    //ADXL345_WRITE_AND_VERIFY(ADXL345_FIFO_CTL,0x90); //90 int1 // b0 int2 - stream mode 16 samples


    //////////////////////// adxl345 int enable /////////////






    else {

        UARTprintf("ACCEL NOT CONNECTED");


thanks for your help