<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MMA8652FC tap detection in Sensors</title>
    <link>https://community.nxp.com/t5/Sensors/MMA8652FC-tap-detection/m-p/330893#M885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;By writing 0x04 to the CTRL_REG4 register, you are actually enabling the Freefall/Motion interrupt. To enable the Pulse detection interrupt you need to set the INT_EN_PULSE bit by writing 0x08 to the CTRL_REG4 register. Then you should be able to see an active low interrupt on the INT2 pin when a tap or double-tap event on any axis is detected. Note that &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;it is necessary to read the PULSE_SRC register to clear the SRC_PULSE bit in the INT_SOURCE register and consequently deassert the interrupt.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Attached you can find my example code written for the &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MMA8652FC"&gt;MMA8652FC&lt;/A&gt; that demonstrates how to use the auto-wake/sleep function with the pulse (tap) function used to wake up the device.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Let me know whether or not this helps, or if you have any other questions. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Tomas&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;&lt;EM style="font-family: Arial, sans-serif; color: #333333;"&gt;&lt;SPAN style="font-weight: inherit; font-size: 11px; font-family: inherit; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;PS:&lt;SPAN class="Apple-converted-space" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-size: 11px; font-family: inherit; color: #3d3d3d;"&gt;If my answer helps to solve your question, please mark it as "Correct" or “Helpful”. Thank you.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Aug 2014 11:27:21 GMT</pubDate>
    <dc:creator>TomasVaverka</dc:creator>
    <dc:date>2014-08-04T11:27:21Z</dc:date>
    <item>
      <title>MMA8652FC tap detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8652FC-tap-detection/m-p/330892#M884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm currently working with a MMA8652FC 3-Axis, 12-bit Digital Accelerometer. I've been able to configure the sensor and read axis data (acc) from a MSP430 MCU but now I want to go a step further. This time I want the MMA8652FC to cause an interrupt whenever a tap or a double-tap is detected but I've been unable to find any related documentation or example in the web. Only AN4083 explains how to configure generic interrupts but the pulse detection seems to be much more complicated with all those partial enabling bits and threshold values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is how I'm configuring the sensor so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Enter STANDBY mode&lt;/P&gt;&lt;P&gt;accel.write(MMA8652_CTRL_REG1&amp;nbsp; 0);&lt;/P&gt;&lt;P&gt;// Dynamic range&lt;/P&gt;&lt;P&gt;accel.write(MMA8652_XYZ_DATA_CFG&amp;nbsp; 0);&amp;nbsp; // Dynamic range = +-2g&lt;/P&gt;&lt;P&gt;// Enable interrupts&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;accel.write(MMA8652_CTRL_REG3, 0x10)&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;// Pulse function interrupt can wake-up system&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// Enable Pulse detection&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;accel.write(MMA8652_CTRL_REG4, 0x04)&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;// Enable Pulse Detection Interrupt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;// Enable pulse detection on each axis&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;accel.write(MMA8652_PULSE_CFG, &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x55);&amp;nbsp; // Enable single Pulse Detection on all axis&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;// Pulse thresholds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;accel.write(MMA8652_PULSE_THSX, &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;0x0A); // Threshold X = 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;accel.write(MMA8652_PULSE_THSY, &lt;SPAN style="font-size: 10pt;"&gt;0x0A); // Threshold Y = 10&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;accel.write(MMA8652_PULSE_THSZ, &lt;SPAN style="font-size: 10pt;"&gt;0x0A); // Threshold Z = 10&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// Enter ACTIVE mode&lt;/P&gt;&lt;P&gt;accel.write(MMA8652_CTRL_REG1&amp;nbsp; 0x21);&amp;nbsp;&amp;nbsp;&amp;nbsp; // ACTIVE mode, Normal mode, data rate = 400 Hz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code is supposed to generate a (falling) interrupt on INT2 when a tap or double-tap event is detected but it's not the case. Is there any sample code where I could get some ideas from?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2026 21:07:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8652FC-tap-detection/m-p/330892#M884</guid>
      <dc:creator>estratos</dc:creator>
      <dc:date>2026-02-03T21:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8652FC tap detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8652FC-tap-detection/m-p/330893#M885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;By writing 0x04 to the CTRL_REG4 register, you are actually enabling the Freefall/Motion interrupt. To enable the Pulse detection interrupt you need to set the INT_EN_PULSE bit by writing 0x08 to the CTRL_REG4 register. Then you should be able to see an active low interrupt on the INT2 pin when a tap or double-tap event on any axis is detected. Note that &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;it is necessary to read the PULSE_SRC register to clear the SRC_PULSE bit in the INT_SOURCE register and consequently deassert the interrupt.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Attached you can find my example code written for the &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MMA8652FC"&gt;MMA8652FC&lt;/A&gt; that demonstrates how to use the auto-wake/sleep function with the pulse (tap) function used to wake up the device.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Let me know whether or not this helps, or if you have any other questions. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Tomas&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;&lt;EM style="font-family: Arial, sans-serif; color: #333333;"&gt;&lt;SPAN style="font-weight: inherit; font-size: 11px; font-family: inherit; color: #3d3d3d;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;PS:&lt;SPAN class="Apple-converted-space" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-size: 11px; font-family: inherit; color: #3d3d3d;"&gt;If my answer helps to solve your question, please mark it as "Correct" or “Helpful”. Thank you.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 11:27:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8652FC-tap-detection/m-p/330893#M885</guid>
      <dc:creator>TomasVaverka</dc:creator>
      <dc:date>2014-08-04T11:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8652FC tap detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8652FC-tap-detection/m-p/330894#M886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some additional information:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PULSE_SOURCE register (0x22) does show pulses occurring on each axis.&lt;/P&gt;&lt;P&gt;INT_SOURCE register (0x0C) always shows value 0, which means that no event is detected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 11:31:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8652FC-tap-detection/m-p/330894#M886</guid>
      <dc:creator>estratos</dc:creator>
      <dc:date>2014-08-04T11:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8652FC tap detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8652FC-tap-detection/m-p/330895#M887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Have you already set the &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;INT_EN_PULSE bit by writing 0x08 to the CTRL_REG4 register? It seems like the Pulse detection interrupt has not been enabled yet.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Tomas&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 12:06:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8652FC-tap-detection/m-p/330895#M887</guid>
      <dc:creator>TomasVaverka</dc:creator>
      <dc:date>2014-08-04T12:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8652FC tap detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8652FC-tap-detection/m-p/330896#M888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Thomas!! What a stupid mistake...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2014 14:50:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8652FC-tap-detection/m-p/330896#M888</guid>
      <dc:creator>estratos</dc:creator>
      <dc:date>2014-08-04T14:50:32Z</dc:date>
    </item>
  </channel>
</rss>

