AnsweredAssumed Answered

Activity interrupt not generated in ADXL345

Question asked by Awrak on Apr 14, 2015
Latest reply on Apr 21, 2015 by neilzhao

Hi,

I have a question regarding the working of Activity & Inactivity functionality in ADXL345.

Do I always have to read X, Y & Z values for the ADXL345 to detect activity & inactivity?

Can they still work if I do not read X, Y & Z registers.

 

The reason I am asking this question is because I have an ADXL345 connected to PIC32, I'm reading X, Y & Z registers & sending them only if activity is sensed else not. Here is the flow of my code in main()...

 

int main(){

        Other code

        .......

        if(FLAGS.Activity){

                 Read_X_Y_Z_Registers( );

                 // Here I am reading X, Y & Z registers only if FLAGS.Activity is set

                 Send_X_Y_Z_Values();

                 ...

        }

}

Here, activity interrupt does not seem to generate at all after inactivity interrupt is generated.


I change the flow of my code & both activity & inactivity functionalities are working perfectly.

int main(){

        Other code

        .......

        Read_X_Y_Z_Registers( );

        if(FLAGS.Activity){

                 Send_X_Y_Z_Values();

                 ...  

        }

}

So, is it necessary to always read the X, Y & Z registers for activity & inactivity functionalities to work properly.

Can I configure the ADXL345 only for Activity & Inactivity detection without needing to read X, Y & Z registers.

P.S

I have set the registers in AC coupled operation for both Activity & Inactivity.

Outcomes