<?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 Problem with Arduino &amp; MMA8451 interrupt settings in Sensors</title>
    <link>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758179#M4879</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I am building a game using a MMA8451Q breakout board connected to an Arduino Uno.&amp;nbsp; The standalone device, powered by battery, must create an interrupt if z-axis acceleration exceeds a value (say, 2g) AND the vertical movement exceeds a value (say, 30mm).&amp;nbsp; I calculate the vertical movement by double-integrating the positive acceleration readings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that tell-tales I have in the software show inconsistent results between vertical lifts.&amp;nbsp; Even when it appears to work, the vertical acceleration required to get it to wake up and fire is way more than the threshold I have set.&amp;nbsp; I have been struggling with this problem for weeks now.&amp;nbsp; The Application Notes for the MMA are confusing for me, and I would really appreciate some feedback on my&amp;nbsp;software, and particularly the register settings, which I attach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in anticipation!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Feb 2026 23:43:59 GMT</pubDate>
    <dc:creator>markross-smith</dc:creator>
    <dc:date>2026-02-03T23:43:59Z</dc:date>
    <item>
      <title>Problem with Arduino &amp; MMA8451 interrupt settings</title>
      <link>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758179#M4879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I am building a game using a MMA8451Q breakout board connected to an Arduino Uno.&amp;nbsp; The standalone device, powered by battery, must create an interrupt if z-axis acceleration exceeds a value (say, 2g) AND the vertical movement exceeds a value (say, 30mm).&amp;nbsp; I calculate the vertical movement by double-integrating the positive acceleration readings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that tell-tales I have in the software show inconsistent results between vertical lifts.&amp;nbsp; Even when it appears to work, the vertical acceleration required to get it to wake up and fire is way more than the threshold I have set.&amp;nbsp; I have been struggling with this problem for weeks now.&amp;nbsp; The Application Notes for the MMA are confusing for me, and I would really appreciate some feedback on my&amp;nbsp;software, and particularly the register settings, which I attach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in anticipation!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2026 23:43:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758179#M4879</guid>
      <dc:creator>markross-smith</dc:creator>
      <dc:date>2026-02-03T23:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Arduino &amp; MMA8451 interrupt settings</title>
      <link>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758180#M4880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mark,&lt;/P&gt;&lt;P&gt;First of all, I recommend using the example project below as a reference for your project in terms of the device initial configuration:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-98836"&gt;MMA8451Q - Bare metal example project&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to detect a quick jerk in the Z-axis, have you considered using the &lt;STRONG&gt;transient detection function&lt;/STRONG&gt; of the device? The transient detection mechanism can be configured to raise an interrupt when the magnitude of the acceleration threshold is exceeded, so I recommend using it.&lt;/P&gt;&lt;P&gt;Please review the application note below in order to get more information:&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/sensors/doc/app_note/AN4071.pdf"&gt;High-Pass Filtered Data and Transient Detection Using the MMA8451&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if you have any further question.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 18:10:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758180#M4880</guid>
      <dc:creator>david_diaz</dc:creator>
      <dc:date>2017-12-05T18:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Arduino &amp; MMA8451 interrupt settings</title>
      <link>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758181#M4881</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;Thanks for your prompt reply.&amp;nbsp; Unfortunately, I have already tried both of your suggestions.&amp;nbsp; In fact, I started out using Transient Detection but had no success with that at all.&amp;nbsp; I'm sure my code problem stems from the Loop where variables are not being reset, or g readings are being stored somewhere and printed out in the serial screen at the next lift.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An earlier version of my program - before I started Sleep/Wake/Interrupt - worked very well with slow lifts and gave accurate upward displacements.&amp;nbsp; The same Motion Detection settings on the latest version now require a significant upwards jerk to record anything, and the displacement is totally inaccurate.&amp;nbsp; This makes me think that data is being lost or saved during the sleep/wake cycles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any other suggestions for me please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 21:41:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758181#M4881</guid>
      <dc:creator>markross-smith</dc:creator>
      <dc:date>2017-12-05T21:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Arduino &amp; MMA8451 interrupt settings</title>
      <link>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758182#M4882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all, let me check with you your program. If I well understand:&lt;/P&gt;&lt;P&gt;- The arduino init the sensor and then goes into sleep mode (the sensor is also in sleep mode).&lt;/P&gt;&lt;P&gt;- When the transient function is triggered, the MMA8451 switches to normal mode.&lt;/P&gt;&lt;P&gt;- I guess the sensor interrupt is catched by your arduino and this wake it up. This is just strange how you coded it. It should be an external interrupt handler and not called in a loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-cpp line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;setup&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// your init&lt;/SPAN&gt;

&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;pin2Interrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="token function"&gt;detachInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;digitalPinToInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pin2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// stop firing while interrupt pin is low&lt;/SPAN&gt;
&amp;nbsp; Serial&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;println&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ISR Arduino Awake!"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="token function"&gt;exitSleep&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;exitSleep&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="token function"&gt;sleep_disable&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// I think this is automaticaly done by your LPWU pin)&lt;/SPAN&gt;
&amp;nbsp; Serial&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;println&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Arduino exiting sleep"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;enterSleep&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; Serial&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;println&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Loop Arduino entering sleep"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;attachInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;digitalPinToInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pin2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; pin2Interrupt&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; LOW&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// Setup pin2 as an interrupt and attach handler&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="token function"&gt;set_sleep_mode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SLEEP_MODE_PWR_DOWN&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="token function"&gt;sleep_enable&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; 
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;loop&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;enterSleep&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;// when wake up interrupt goes there&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;x &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; reps&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cumS &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; minLift&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// while loop with 2 conditions&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;//&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;- then the arduino try to compute the displacement from the acceleration&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;About your&amp;nbsp;MMA8451 configuration:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" height="177" style="border: 1px solid #c6c6c6;" width="895"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef; height: 25px;"&gt;&lt;TH style="width: 157px; height: 25px;"&gt;Register&lt;/TH&gt;&lt;TH style="width: 82px; height: 25px;"&gt;Value&lt;/TH&gt;&lt;TH style="width: 622px; height: 25px;"&gt;Description&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 157px; height: 25px;"&gt;&lt;SPAN&gt;CRTL_REG1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 82px; height: 25px;"&gt;0x21&lt;/TD&gt;&lt;TD style="width: 622px; height: 25px;"&gt;Active mode, Normal ODR=50Hz, Sleep ODR=50Hz&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 157px; height: 25px;"&gt;&lt;SPAN&gt;CRTL_REG2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 82px; height: 25px;"&gt;0x1E&lt;/TD&gt;&lt;TD style="width: 622px; height: 25px;"&gt;SleepMode= Low Power, NormalMode=High Resolution, AutoSleep enabled&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 157px; height: 25px;"&gt;&lt;SPAN&gt;CRTL_REG3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 82px; height: 25px;"&gt;0x40&lt;/TD&gt;&lt;TD style="width: 622px; height: 25px;"&gt;Transient function wakes the system&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 157px; height: 25px;"&gt;&lt;SPAN&gt;CRTL_REG4&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 82px; height: 25px;"&gt;0x20&lt;/TD&gt;&lt;TD style="width: 622px; height: 25px;"&gt;Transient Interrupt enabled&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 157px; height: 25px;"&gt;&lt;SPAN&gt;CRTL_REG5&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 82px; height: 25px;"&gt;0x20&lt;/TD&gt;&lt;TD style="width: 622px; height: 25px;"&gt;Interrupt routed on INT1&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 157px; height: 25px;"&gt;&lt;SPAN&gt;XYZ_DATA_CFG&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 82px; height: 25px;"&gt;0x00&lt;/TD&gt;&lt;TD style="width: 622px; height: 25px;"&gt;FSR to +/-2g&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 157px; height: 25px;"&gt;&lt;SPAN&gt;ASLP_COUNT&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 82px; height: 25px;"&gt;0x03&lt;/TD&gt;&lt;TD style="width: 622px; height: 25px;"&gt;Minimum period of activity = 3 / SleepODR =&amp;nbsp; 60ms&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 157px; height: 25px;"&gt;&lt;SPAN&gt;TRANSIENT_CFG&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 82px; height: 25px;"&gt;0x08&lt;/TD&gt;&lt;TD style="width: 622px; height: 25px;"&gt;Transient detection on Z axis enabled&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 157px; height: 25px;"&gt;&lt;SPAN&gt;TRANSIENT_THS&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 82px; height: 25px;"&gt;0x05&lt;/TD&gt;&lt;TD style="width: 622px; height: 25px;"&gt;Threshold set to 0.063*5 = 315 mg&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 157px; height: 25px;"&gt;&lt;SPAN&gt;TRANSIENT_COUNT&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 82px; height: 25px;"&gt;0x03&lt;/TD&gt;&lt;TD style="width: 622px; height: 25px;"&gt;Debounce set to 3/&lt;SPAN&gt;SleepODR&amp;nbsp;&lt;/SPAN&gt; = 60ms (Sleep mode to normal mode wake up)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to your application, I'm not sure the MMA8451 settings are well chosen.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly, the sleep mode/active mode option&amp;nbsp;is not really valuable as you only change the Power/Resolution Mode and not the ORD. In fact your ODR in normal mode seems pretty slow, I would recommend you to increase it to&amp;nbsp; have a better resolution for the displacement calculation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The threshold is set to 315mg. This will not work as the Z-axis see the 1-g Earth gravity. If you want to use the function in a "relative" mode, you need to enable the internal High-Pass filter to remove it.&lt;/P&gt;&lt;P&gt;The debounce (TRANSIENT_COUNT) value of the transient function can be an obstacle for the Z motion detection. With the current parameter, the Z-acceleration must be higher than the threshold during at least 60 ms. You have to make sure it is. It could be better to increase the threshold and reduce the debounce value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I highly recommend you to collect data&amp;nbsp;in a real use case.&amp;nbsp;This can help you to well set the transient function.&amp;nbsp; Below an example of datalog of the Z-axis in a "lift" case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_7.png"&gt;&lt;IMG alt="pastedImage_7.png" src="https://community.nxp.com/t5/image/serverpage/image-id/24918iFA85A7B759907D37/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_7.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About the displacement calculation, usually, we don't recommend our customer to play with that. The double integration of the g value is pretty dangerous, as is can bring a high error and make your result not accurate at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to make it more reliable, you should sample it at a high rate (interval value as small as possible) and also use the trapezoidal rule approximation for the integration instead of the rectangular methods.&lt;/P&gt;&lt;P&gt;&lt;IMG class="j-img-centered" src="https://upload.wikimedia.org/wikipedia/commons/7/7e/Trapezium2.gif" style="display: block; margin-left: auto; margin-right: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:06:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758182#M4882</guid>
      <dc:creator>anthonyduhamel</dc:creator>
      <dc:date>2020-11-02T14:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Arduino &amp; MMA8451 interrupt settings</title>
      <link>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758183#M4883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anthony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks you for your detailed explanation and comments!&amp;nbsp; I certainly see the places I have gone wrong, and I will work through each of your suggestions and see how I go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will respond to this forum when I have some (good!) news.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2017 00:41:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758183#M4883</guid>
      <dc:creator>markross-smith</dc:creator>
      <dc:date>2017-12-15T00:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Arduino &amp; MMA8451 interrupt settings</title>
      <link>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758184#M4884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi againAnthony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quick question: what application do you use to graph the acceleration vs. time in your response above?&amp;nbsp; It would be a very useful tool for me to understand what my settings changes are doing.&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;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Dec 2017 23:07:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758184#M4884</guid>
      <dc:creator>markross-smith</dc:creator>
      <dc:date>2017-12-17T23:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Arduino &amp; MMA8451 interrupt settings</title>
      <link>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758185#M4885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following on from my previous issues, I have realised that I need to use the FIFO interrupt method to extend battery life.&amp;nbsp; I have been successful in setting up the FIFO and the wake interrupt but I realise I don't know how to read the 32 samples from the FIFO registers.&amp;nbsp; I have read that the FIFO buffer can be read as a "burst" or a "flush" of 196 bytes, but I cannot see whether it is one read or 32 reads in a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the following note:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The whole FIFO content is retrieved by performing thirty-two reads from the accelerometer&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;output registers, every other read returns the same last value until a new sample set is&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;available in the FIFO buffer.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Data can be retrieved from FIFO using every reading byte combination in order to increase&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;the application flexibility (ex: 196 single byte reads, 32 reads of 6 bytes, 1 multiple read of&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;196 bytes, etc.).&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;It is recommended to read all FIFO slots in a multiple byte read of 196 bytes (6 output&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;registers by 32 slots) faster than 1*ODR. In order to minimize communication between the&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;master and slave the read address is automatically updated by the device; it rolls back to&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;0x28 when register 0x2D is reached.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't really understand all of that! Please would someone help me with some sample code how these reads would be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jan 2018 03:25:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758185#M4885</guid>
      <dc:creator>markross-smith</dc:creator>
      <dc:date>2018-01-19T03:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Arduino &amp; MMA8451 interrupt settings</title>
      <link>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758186#M4886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no responses to my query from 2 weeks ago.&amp;nbsp; I would like to ask:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In AN4073 (Using FIFO in the MA8451Q) I see in the example 5.1 the following line to "burst out 14 bit data" in the ISR:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ComObj.ReadDataBurst(CurDeviceAddress,0x0q,ref databuf14,192)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using an Arduino Uno as my processor, and I am trying to use the various commands from the Wire.h library such as Wire.requestFrom(), Wire.Available() and Wire.Read().&amp;nbsp; However, I am getting error results, and I think it is because these Wire commands do not include the FIFO start address in the MMA8451Q.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me please?&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;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jan 2018 04:28:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/Problem-with-Arduino-MMA8451-interrupt-settings/m-p/758186#M4886</guid>
      <dc:creator>markross-smith</dc:creator>
      <dc:date>2018-01-31T04:28:06Z</dc:date>
    </item>
  </channel>
</rss>

