When using the tap detect, the application note AN4072 in Figure 2 describes a pulse consisting of a positive pulse followed by a negative pulse. Does this result in two taps? If Double Pulse Abort (DPA) is set, will a full-scale positive followed by a full-scale negative result in an abort condition? Should I turn off the DPA instead?
I’m having a hard time determining why I have inconsistent results in my data.
I’ve attached a screen shot that shows an interrupt on the first double-tap, but not after that. I’ve looked at the data in detail, and feel that the following double-taps should fit the qualifications, but I’m wondering if the DPA is preventing the double-tap from working correctly.
Just a quick question/suggestion - in your ISR, do you acknowledge an IRQ and read the PULSE_SRC register (0x22) to clear the SRC_PULSE bit in the INT_SOURCE register (0x0C) and deassert the INT pin?
Also I cannot find the screen shot, could you please try to attach it again?
Yes, the interrupt is cleared by reading the PULS_SRC register.
Here's the image of the accelerometer data capture and the interrupt. The interrupt is the vertical red line. The rest of the lines as the acceleration data captured without the high pass filter turned on. Pretty much every double-tap looks like it should have triggered the double-tap pulse detect.
Just to be sure, do you acknowledge an IRQ in your ISR by writing a logic 1 to a specific bit of your MCU? Without doing it, the interrupt flag on your MCU will remain active and then you are not able to receive any further double pulse interrupts from the MMA8451Q.
As you can see in our example for single tap, we use: