AnsweredAssumed Answered

ADXL345 Interrupt problem

Question asked by c0de on Sep 23, 2012
Latest reply on Oct 4, 2012 by c0de

Hello everyone,

I need some help in configuring an ADXL345 accelerometer. I work with board which has a NXP lp1114F/301 processor and I need to use the accelerometer to wake up the processor on tap and double tap. I have managed to catch the tap and double tap actions but only if I read continuously the INT_SOURCE register. I think I'm missing something in the device configuration because the data_ready and overrun are always on. I also tried to clear the bits by reading the data register but still no effect. In my application, the accelerometer "should" generate a interrupt on int1 ONLY IF the device is tapped or double tapped. As far as I see, the accelerometer, in my case, generates a an interrupt on the int1 pin only once (no matter which event generated the interrupt) and doesn't put the pin low until the interrupt is cleared, no matter where is the interrupt mapped (int1 or int2). Is this a normal behaviour or I'm missing something? How can I configure it to generate an interrupt on int1 everytime this event occurs without being influenced bu the other interrupt events? Is it possible to configure the accelerometer to have interrupts on tap or double tap, (without measuring and storing data to data registers)

Basically I need only the tap and double tap interrupts, which should wake up the processor.

Next is the code I use for accelerometer initialization:

  ADXL345_Write(ADXL345_DATA_FORMAT,0x01);

  ADXL345_Write(ADXL345_TAP_AXES,0x01);    

  ADXL345_Write(ADXL345_THRESH_TAP,0x38);

  ADXL345_Write(ADXL345_DUR,0x10);

  ADXL345_Write(ADXL345_LATENT,0x50);

  ADXL345_Write(ADXL345_WINDOW,0xFF);

  ADXL345_Write(ADXL345_INT_MAP,0x9F);

  ADXL345_Write(ADXL345_INT_ENABLE,0x60);

  ADXL345_Write(ADXL345_POWER_CTL,0x08);

 

Any help would be appreciated.

Thank you

Cosmin

Outcomes