<?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: MMA8452 Tap direction detection in Sensors</title>
    <link>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489979#M2971</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Fernando,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;SPAN style="text-decoration: underline;"&gt;read-only&lt;/SPAN&gt; &lt;STRONG&gt;PULSE_SRC&lt;/STRONG&gt; register, indicates a double or single pulse event has occurred and also which direction. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, the most&lt;STRONG&gt; efficient way to access data&lt;/STRONG&gt; &lt;STRONG&gt;is to use the internal 32-sample FIFO buffer&lt;/STRONG&gt; because this minimizes the number of I2C transactions,&lt;SPAN style="text-decoration: underline;"&gt; but it does not mean that the PULSE_SRC register does not work properly without the FIFO&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I mentioned before, it is possible to read the tap direction only using the PULSE_SRC register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this information helps.&lt;/P&gt;&lt;P&gt;If I misunderstood your question, feel free to let me know.&amp;nbsp; I will be glad to help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day.&lt;/P&gt;&lt;P&gt;David Diaz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Feb 2016 22:08:37 GMT</pubDate>
    <dc:creator>david_diaz</dc:creator>
    <dc:date>2016-02-05T22:08:37Z</dc:date>
    <item>
      <title>MMA8452 Tap direction detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489978#M2970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the SparkFun breakout board with the MMA8452 accelerometer to validate user interaction without buttons. I need to be able to identify the tap direction for that. I'm not understanding why there are bits for identifying the tap direction in the PULSE_SRC register but there is an applciation note that says to process the data in the FIFO to calculate the direction. Is it possible to read the tap direction only using the PULSE_SRC bits? Does this work well, or to get good results we must process the FIFO data after detecting the tap?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2026 21:55:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489978#M2970</guid>
      <dc:creator>fernandogomes</dc:creator>
      <dc:date>2026-02-03T21:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8452 Tap direction detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489979#M2971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Fernando,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;SPAN style="text-decoration: underline;"&gt;read-only&lt;/SPAN&gt; &lt;STRONG&gt;PULSE_SRC&lt;/STRONG&gt; register, indicates a double or single pulse event has occurred and also which direction. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, the most&lt;STRONG&gt; efficient way to access data&lt;/STRONG&gt; &lt;STRONG&gt;is to use the internal 32-sample FIFO buffer&lt;/STRONG&gt; because this minimizes the number of I2C transactions,&lt;SPAN style="text-decoration: underline;"&gt; but it does not mean that the PULSE_SRC register does not work properly without the FIFO&lt;/SPAN&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I mentioned before, it is possible to read the tap direction only using the PULSE_SRC register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this information helps.&lt;/P&gt;&lt;P&gt;If I misunderstood your question, feel free to let me know.&amp;nbsp; I will be glad to help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day.&lt;/P&gt;&lt;P&gt;David Diaz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 22:08:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489979#M2971</guid>
      <dc:creator>david_diaz</dc:creator>
      <dc:date>2016-02-05T22:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8452 Tap direction detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489980#M2972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David, thanks for your answer! Can you clarify how it is more efficient to read the FIFO then using the direction bits on the PULSE_SRC register? As far as I understand from the application note AN4072, after reading the FIFO it is neessary to calculate max and min and calculate the differences, while reading a single register (PULSE_SRC) there are already three bits that indicate the tap direction. I am having some issues identifying the tap direction, and even to distinguish between taps on different axis. I'm not getting coherent results, at least not enough stable that I can use them to replace onventional buttons. This is a prototype for a product for a customer that wants to remove all the enclosure buttons, so the acelerometer could be a good alternative, but I need to get coherent results, taps in one axis shouldn't trigger taps in other axis, for example. Do you know if it is possible to achieve this with this type of accelerometer? Do you know any example that I could use as a base for this type of use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 23:09:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489980#M2972</guid>
      <dc:creator>fernandogomes</dc:creator>
      <dc:date>2016-02-05T23:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8452 Tap direction detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489981#M2973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Fernando, &lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;You may review the &lt;SPAN style="color: red;"&gt;&lt;A href="http://cache.freescale.com/files/sensors/doc/app_note/AN4073.pdf" title="http://cache.freescale.com/files/sensors/doc/app_note/AN4073.pdf"&gt;Application Note AN4073&lt;/A&gt;&lt;/SPAN&gt;, in order to get a better understanding of using the FIFO in the MMA845X. &lt;/P&gt;&lt;P style="text-align: justify;"&gt;&lt;/P&gt;&lt;P style="text-align: justify;"&gt;Indeed, The FIFO is very beneficial for saving overall system power by putting the processor into sleep mode until it needs to process data from the accelerometer; in other words, the FIFO allows the processor to sleep longer while samples are being collected inside the sensor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The AN4073 mentioned before, counts with example codes using the FIFO as well as the registers of importance for using it. &lt;/P&gt;&lt;P&gt;Please refer to the &lt;STRONG&gt;Chapter 5.2&lt;/STRONG&gt; in order to get the desired example code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feel free to let me know if this information is useful for you.&lt;/P&gt;&lt;P&gt;If I misunderstood your question, feel free to let me know.&amp;nbsp; I will be glad to help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day.&lt;/P&gt;&lt;P&gt;David Diaz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt;"&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 18:13:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489981#M2973</guid>
      <dc:creator>david_diaz</dc:creator>
      <dc:date>2016-02-09T18:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8452 Tap direction detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489982#M2974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help. I was reading the code you proposed, but unfortunatly the chip I'm using is the MMA8452Q, so it doesn't have the FIFO, only the MMA8451 has the FIFO, am I right? Any other sugestion? What I find is that even with 'simple' tap detection implemented (not using the FIFO, only the TAP detection bits, as defined in AN4072, section 6.1) it is common to get TAPs detected in the wrong axes, for example a TAP in the x axis gets an event in the Y or Z axis.Is there any recomendation to have better results? It works well to detect that a device got a TAP but not well to distinguish the TAP axis or direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 21:57:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489982#M2974</guid>
      <dc:creator>fernandogomes</dc:creator>
      <dc:date>2016-02-09T21:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8452 Tap direction detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489983#M2975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Fernando,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please accept my apologies for the delay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Indeed, unfortunately the MMA8452Q devices does not count with FIFO buffer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A single tap event is configured by specifying two things; the &lt;STRONG&gt;threshold to be crossed&lt;/STRONG&gt; and the &lt;STRONG&gt;time duration&lt;/STRONG&gt; that it lasts. &lt;/P&gt;&lt;P&gt;I would recommend to configure the &lt;STRONG&gt;PULSE_THSX,Y,Z&lt;/STRONG&gt; and &lt;STRONG&gt;PULSE_TMLT &lt;/STRONG&gt;registers in order to improve the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="tap detection.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/53337i24F2EDDACEAA8228/image-size/large?v=v2&amp;amp;px=999" role="button" title="tap detection.jpg" alt="tap detection.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if the issue remains despite configuring the registers mentioned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for writing to the NXP communities. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day. &lt;/P&gt;&lt;P&gt;David &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 01:34:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489983#M2975</guid>
      <dc:creator>david_diaz</dc:creator>
      <dc:date>2016-02-16T01:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8452 Tap direction detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489984#M2976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David, thanks for your answer. I am already using these registers, I'm programming it according to the AN4072, page 17:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;// AN4072, pag 17, TAP and Double-TAP Detection&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(CTRL_REG1, 0x10); //200 Hz, Standby Mode&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(PULSE_CFG, 0x3F); //Enable X, Y, Z Single Pulse and X, Y and Z Double Pulse with DPA = 0 no double pulse abort&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(PULSE_THSX, 0x20); //Set X Threshold to 2g&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(PULSE_THSY, 0x20); //Set Y Threshold to 2g&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(PULSE_THSZ, 0x40); //Set Z Threshold to 4g&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(PULSE_TMLT, 0x18); //60 ms&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(PULSE_LTCY, 0x28); //200 ms&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(PULSE_WIND, 0x3C); //300 ms&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(CTRL_REG3, 0x02); //Interrupt polarity active high (FG)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(CTRL_REG4, 0x08); //Enable Pulse Interrupt Block in System CTRL_REG4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(CTRL_REG5, 0x08); //Route Pulse Interrupt Block to INT1 hardware Pin CTRL_REG5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;uint8_t CTRL_REG1_Data = readRegister(CTRL_REG1); //Read out the contents of the register &lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CTRL_REG1_Data |= 0x01; //Change the value in the register to Active Mode.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;writeRegister(CTRL_REG1, CTRL_REG1_Data); //Write in the updated value to put the device in Active Mode&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;What I reported as a non deterministic behavior I found later a way to reproduce it, please tell me if this is expected. During my tests I power the system (the init code above runs), I have the accelerometer held horizontally and the tap and double tap on the X and Y axis work well (I'm not using the Z axis). The problem occurs in the 'next day', I left the system powered during the night for other tests only MCU related, but since I'm using a breakout board for the accelerometer, connected by flexible wires to the MCU, it "falls" getting the accelerometer in the vertical position during all the night. In the morning after I grab again the accelerometer in the horizontal position but the X and Y taps and double taps don't work well. I validated this suspicion keeping the accelerometer horizontal during the night (it worked well in the morning), or resetting the MCU in the morning (the init code above runs again, and the taps and double taps starts working well immediately). Is this the expected behavior? Does it have to do with calibration?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 09:44:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489984#M2976</guid>
      <dc:creator>fernandogomes</dc:creator>
      <dc:date>2016-02-16T09:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8452 Tap direction detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489985#M2977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;Hello Fernando,&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;Once again, accept my apologies for the delay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;Definitively, that is a weird situation. I have never heard something like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;I would like to know if the temperature changes during the night.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;Please be aware that the temperature change could affect the performance of the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;In this case I would recommend setting the MMA8452 registers as follow:&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(CTRL_REG1, 0x0C);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// ODR = 400Hz, Reduced noise, Standby mode &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(XYZ_DATA_CFG_REG, 0x00);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// +/-2g range -&amp;gt; 1g = 16384/4 = 4096 counts &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(CTRL_REG2, 0x02);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// High Resolution mode&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(PULSE_CFG_REG, 0x15);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;//Enable X, Y and Z Single Pulse&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(PULSE_THSX_REG, 0x20);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;//Set X Threshold to 2.016g&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(PULSE_THSY_REG, 0x20);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;//Set Y Threshold to 2.016g&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(PULSE_THSZ_REG, 0x2A);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;//Set Z Threshold to 2.646g&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(PULSE_TMLT_REG, 0x28);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;//Set Time Limit for Tap Detection to 25 &lt;SPAN style="text-decoration: underline;"&gt;ms&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(PULSE_LTCY_REG, 0x28);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;//Set Latency Time to 50 &lt;SPAN style="text-decoration: underline;"&gt;ms&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(CTRL_REG4, 0x08);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;//Pulse detection interrupt enabled&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(CTRL_REG5, 0x08);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;//Route INT1 to system interrupt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CTRL_REG1_val = I2C_ReadRegister(CTRL_REG1);&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: #3f7f5f;"&gt;//Active Mode&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CTRL_REG1_val |= 0x01;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I2C_WriteRegister(CTRL_REG1, CTRL_REG1_val);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;Please let me know if the issue remains besides this configuration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;Finally, I would like to share with you, a sample project that could be useful for you.&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;Please find the sample project at &lt;A href="https://community.nxp.com/docs/DOC-329888"&gt;MMA8451Q -Single Tap Detection Bare metal example project&lt;/A&gt; .&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: -.5in;"&gt;I hope you find it useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I misunderstood your question, feel free to let me know.&amp;nbsp; I will be glad to help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day.&lt;/P&gt;&lt;P&gt;David Diaz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 00:47:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489985#M2977</guid>
      <dc:creator>david_diaz</dc:creator>
      <dc:date>2016-02-19T00:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: MMA8452 Tap direction detection</title>
      <link>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489986#M2978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear David, thanks for your help, I'll try with your code to see if it&lt;/P&gt;&lt;P&gt;solves the issue. Some temperature change might occur during the night (no&lt;/P&gt;&lt;P&gt;heating during the night), but it won't be larger than 2ºC to 3ºC I think,&lt;/P&gt;&lt;P&gt;so it doesn't seem to me that this should be the problem. And also if i&lt;/P&gt;&lt;P&gt;keep the sensor in the horizontal position during the night (or if I reset&lt;/P&gt;&lt;P&gt;the MCU in the morning) it still works well in the morning. I'll reply here&lt;/P&gt;&lt;P&gt;when I test with your code!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Fri, Feb 19, 2016 at 12:48 AM, david_diaz &amp;lt;admin@community.freescale.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 10:28:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MMA8452-Tap-direction-detection/m-p/489986#M2978</guid>
      <dc:creator>fernandogomes</dc:creator>
      <dc:date>2016-02-19T10:28:30Z</dc:date>
    </item>
  </channel>
</rss>

