To Everyone;
I have been integration a project with Arduino with atMega328p & ADXL345. I got a Free Fall interrupt from INT1(Connected to D3) however was not able to clear it. I discovered that reading INT_SOURCE does not help totally, you should first disable interrupt from INT_ENABLE & INT_MAP then read INT_SOURCE & enable it again for repetitive interrupts.
I add the functions below to ADXL345 library.(using I2C)
void ADXL345::EnableInterrupt()
{
Write(THRESH_FF, 0x0A);
Write(TIME_FF , 0x10);
uint8_t interruptsr = Read(INT_ENABLE,1)[0];
interruptsr |= FREE_FALL; //interruptsr = FREE_FALL;
Write(INT_ENABLE,interruptsr);
Write(THRESH_FF, 0x07);
Write(TIME_FF , 0x10);
interruptsr = Read(INT_MAP,1)[0];
interruptsr &= ~FREE_FALL;
Write(INT_MAP,interruptsr);
}
void ADXL345::DisableInterrupt()
{
uint8_t interruptsr = Read(INT_ENABLE,1)[0];
interruptsr &= ~FREE_FALL; //clear
Write(INT_ENABLE,interruptsr);
interruptsr = Read(INT_MAP,1)[0];
interruptsr |= FREE_FALL;
Write(INT_MAP,interruptsr);
}
Hope to help you…