MMA8652 Tap vs Motion

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MMA8652 Tap vs Motion

1,766 Views
edmon
Contributor II

Hi, I have been working with the MMA8652FC 3-axis Accelerometer for quite some time now. I've been playing with the registers, that I can already read data and configure some interrupt. I am also able to create a “sleep-to-wake up” program using TAP detection of the IC. Now, for my next step, I want to able to determine a TAP when in motion. Is it possible?

Tags (1)
0 Kudos
7 Replies

970 Views
david_diaz
NXP Employee
NXP Employee

Hello Edmon,

Thank you for writing to the NXP communities.

The Motion is often used to simply alert the main processor that the device is currently in use. When the acceleration exceeds a set threshold, the motion interrupt is asserted. On the other hand, the Tap detection function has various customizing timers, for setting the pulse time width and the latency time between pulses.

As a summary, Motion detection detects a threshold and Tap detection detects pulses.

Are you planning to route these interrupt sources to the interrupt pins?

In case it is useful for you, I would like to recommend the following application notes:

1. AN4070 - Motion and Freefal Detection Using the MMA8451, 2, 3Q

2. AN4072 - MMA8451, 2, 3Q Single/Double and Directional Tap Detection

I hope this information will be useful for you.

If I misunderstood your question, feel free to let me know.  I will be glad to help.

Have a great day.

David Diaz.

970 Views
edmon
Contributor II

Hi David,

Thank you for the documents! It helps me a lot but not quite there yet.

My follow-up question:

By reading PULSE_SRC (0x22), will it show me which side of the IC or board I am tapping? Is tapping at the bottom side mean negative pulse in z-axis?  Will it set bit 2 to 1? As I don’t always get consistent value when I tap at the bottom side.

I just want to disregard a pulse (negative?) caused by a tapping the table or something which my board is place. I want only a tap coming from the  top or direct hit/shock.

Do you have a better way to do this?

Thanks again,

Edmon

0 Kudos

970 Views
david_diaz
NXP Employee
NXP Employee

Hello Edmon,

Accept my apologies for the delay.

Indeed, the PULSE_SRC register indicates a double or single pulse event has occurred and also which direction.

By reading the register mentioned, you can configure your application in case you want to disregard the Z-axis positive/negative direction.

For example, if you tap the device in the Z-axis and negative direction, you will read the PULSE_SRC register as follow:

negative Z TAP.jpg

In this case, I would like to recommend a sample project that could be useful for you in order to read the PULSE_SRC register.

Please find the sample project at MMA8451Q -Single Tap Detection Bare metal example project .

I hope you find it useful.

If I misunderstood your question, feel free to let me know.  I will be glad to help.

Have a great day.

David Diaz.

0 Kudos

970 Views
edmon
Contributor II

Hi David,

When tapping at the negative side, I sometimes read PULSE_SCR = 0xC4 or 0xC0. Does this value depends on how strong i tap?

Regards,

Edmon

0 Kudos

970 Views
david_diaz
NXP Employee
NXP Employee

Hello Edmon,

I have to personally apologize for the long delay it took to come back to you.

For a single tap event there are three key parameters to consider.

  1. Time Window for the tap signature to cross a threshold and drop below it (PULSE_TMLT)
  2. Threshold Value to Trigger the event (PULSE_THSX, PULSE_THSY, PULSE_THSZ)
  3. Latency time to hold the event conditions (PULSE_LTCY)

threshold2.jpg

In this case, you may modify the pulse Z threshold register in order to define the threshold used by the system.

threshold.jpg

Please let me know if this information is useful for you.

If I misunderstood your question, feel free to let me know.  I will be glad to help.

Have a great day.

David Diaz.

Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 Kudos

970 Views
anthonyduhamel
NXP Employee
NXP Employee

Hi Edmon,

I'm not sure to understand your query. Do you mean by "TAP when in motion" that you want to discard TAP when there is no motion or are you asking if the TAP detection works when the MMA8652FC is moving?

Thanks,

Anthony

970 Views
edmon
Contributor II

Hi Anthony,

Thanks for the reply.

I want to figure out if the TAP detection works when MMA8652FC is moving. I'm not sure how the line is drawn between a tap and motion. As sometimes motion/movement will also generate a "PULSE/TAP" interrupt.

Cheers, Edmon

0 Kudos