<?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: accelerometer vector magnitude in Sensors</title>
    <link>https://community.nxp.com/t5/Sensors/accelerometer-vector-magnitude/m-p/421408#M1909</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Meir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, the correct link is: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-106050"&gt;https://community.freescale.com/docs/DOC-106050&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try to reproduce my settings and let me know if the problem persists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Aug 2015 08:47:07 GMT</pubDate>
    <dc:creator>TomasVaverka</dc:creator>
    <dc:date>2015-08-12T08:47:07Z</dc:date>
    <item>
      <title>accelerometer vector magnitude</title>
      <link>https://community.nxp.com/t5/Sensors/accelerometer-vector-magnitude/m-p/421405#M1906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi i encounter an odd response when trying to use the A_VECM feature in FXOS8700.&lt;/P&gt;&lt;P&gt;i have the following piece of code: &lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;MMA865x_Standby();&lt;/P&gt;&lt;P&gt;IIC_RegWrite(CTRL_REG4,0x02); //Disable Data Ready interrupts, enable A_VECM interrupts&lt;/P&gt;&lt;P&gt;IIC_RegWrite(A_VECM_THS_MSB,0x80);&amp;nbsp;&amp;nbsp; //update MSB THS, reset when condition fails&lt;/P&gt;&lt;P&gt;print_string("A_VECM_THS_MSB= ",16); print_hex(IIC_RegRead(A_VECM_THS_MSB)); WaitPrintBuffer();&lt;/P&gt;&lt;P&gt;IIC_RegWrite(A_VECM_THS_LSB,Acc_THS);&amp;nbsp;&amp;nbsp; //update LSB THS&lt;/P&gt;&lt;P&gt;print_string("A_VECM_THS_LSB= ",16); print_hex(IIC_RegRead(A_VECM_THS_LSB)); WaitPrintBuffer();&lt;/P&gt;&lt;P&gt;IIC_RegWrite(A_VECM_CNT,Acc_COUNT); //update counter&lt;/P&gt;&lt;P&gt;print_string("A_VECM_CNT= ",13); print_hex(IIC_RegRead(A_VECM_CNT)); printENTER; WaitPrintBuffer();&lt;/P&gt;&lt;P&gt;IIC_RegWrite(A_VECM_CFG,0x78); //0111 1000&amp;nbsp; Latch enable, A_VECM_INIT, don't update reference when event&lt;/P&gt;&lt;P&gt;IIC_RegWrite(M_CTRL_REG1,((IIC_RegRead(M_CTRL_REG1))&amp;amp;(~0x03))); //Enable Accelerometer_Only&lt;/P&gt;&lt;P&gt;Data_Mode= Accelerometer_Only; //notify EX0 interrupt to read Accelerometer data&lt;/P&gt;&lt;P&gt;IIC_RegWrite(M_CTRL_REG2,((IIC_RegRead(M_CTRL_REG2))&amp;amp;(~0x20))); //Disable autoincrement mode&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp; IntSource=IIC_RegRead(TRANSIENT_SRC); //Read 0x1E TRANSIENT_SRC register to clear the interrupt&lt;/P&gt;&lt;P&gt;MMA865x_Active(); //ACTIVATE THE SENSOR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_1438975314850828 jive_macro_code jive_text_macro" data-renderedposition="385_30_1190_16" jivemacro_uid="_1438975314850828" modifiedtitle="true"&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;with this code the program works fine and every time i move the device A_VECM is asserted.&lt;/P&gt;&lt;P&gt;in this stage i decided to delete the print_string() lines.&lt;/P&gt;&lt;P&gt;after i did that the A_VECM is asserted once and not asserted anymore.&lt;/P&gt;&lt;P&gt;i tried to replace the print_string() lines with simple delay: for(i=0; i&amp;lt;60000; i++);&lt;/P&gt;&lt;P&gt;with this line, again A_VECM is asserted with no problems.&lt;/P&gt;&lt;P&gt;i can read CNTR_REG4 and it is set to 0x02. nevertheless the A_VECM is not asserted.&lt;/P&gt;&lt;P&gt;any idea what is the reason for that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2026 22:06:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/accelerometer-vector-magnitude/m-p/421405#M1906</guid>
      <dc:creator>meirsudry</dc:creator>
      <dc:date>2026-02-03T22:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: accelerometer vector magnitude</title>
      <link>https://community.nxp.com/t5/Sensors/accelerometer-vector-magnitude/m-p/421406#M1907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Meir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please look at my &lt;A href="http://https//community.freescale.com/docs/DOC-106050"&gt;example code&lt;/A&gt;. You need to read the INT_SOURCE register (0x0C) to clear the the SRC_A_VECM status bit and deassert the INTx pin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.3333320617676px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;EM&gt;PS: If my answer helps to solve your question, please mark it as "Correct". Thank you.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Aug 2015 07:51:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/accelerometer-vector-magnitude/m-p/421406#M1907</guid>
      <dc:creator>TomasVaverka</dc:creator>
      <dc:date>2015-08-10T07:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: accelerometer vector magnitude</title>
      <link>https://community.nxp.com/t5/Sensors/accelerometer-vector-magnitude/m-p/421407#M1908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your prompt response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately I can’t open the link you sent for your example code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Indeed I copied paste a previous piece of code from a program deal with Transient interrupt so I read the transient source instead of INT_Source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The piece of code I attached in my question is the last part of handling the A_VECM interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Immediately after the interrupt is asserted I do read INT_SOURCE register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, I changed the line as you suggested&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//    IntSource=IIC_RegRead(TRANSIENT_SRC); //Read 0x1E TRANSIENT_SRC register to clear the interrupt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and replaced it with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IntSource=IIC_RegRead(INT_SOURCE); //Read 0x0C INT_SOURCE register to clear the interrupt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem still exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The point in my case is a beat different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like if I have a delay after the line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IIC_RegWrite(CTRL_REG4,0x02); //Disable Data Ready interrupts, enable A_VECM interrupts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do get interrupts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The delay is either by setting and printing several registers (see the code I sent in my question),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or even by simple for(i=0; i&amp;lt;60000; i++);  to implement the delay.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In these cases I do get A_VECM interrupts after the first one, which is always asserted as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the delay is not implemented I don't get interrupts after the 1st that was asserted.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meir SUDRY&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 05:37:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/accelerometer-vector-magnitude/m-p/421407#M1908</guid>
      <dc:creator>meirsudry</dc:creator>
      <dc:date>2015-08-12T05:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: accelerometer vector magnitude</title>
      <link>https://community.nxp.com/t5/Sensors/accelerometer-vector-magnitude/m-p/421408#M1909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Meir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, the correct link is: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-106050"&gt;https://community.freescale.com/docs/DOC-106050&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try to reproduce my settings and let me know if the problem persists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 08:47:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/accelerometer-vector-magnitude/m-p/421408#M1909</guid>
      <dc:creator>TomasVaverka</dc:creator>
      <dc:date>2015-08-12T08:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: accelerometer vector magnitude</title>
      <link>https://community.nxp.com/t5/Sensors/accelerometer-vector-magnitude/m-p/421409#M1910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tomas&lt;/P&gt;&lt;P&gt;thanks for the correct link.&lt;/P&gt;&lt;P&gt;the problem still exist.&lt;/P&gt;&lt;P&gt;see below more details (code) of my project&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sensor initialization&lt;/STRONG&gt;:&lt;/P&gt;&lt;TABLE height="0" style="width: 0px; height: 1px;" width="0"&gt;&lt;TBODY&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #7ed529;"&gt;MMA865x_Standby();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(CTRL_REG4,0x02);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(A_VECM_THS_MSB,0x80);&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(A_VECM_THS_LSB,Acc_THS);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(A_VECM_CNT,Acc_COUNT);&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITX_MSB, 0x00);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITX_LSB, 0x00);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITY_MSB, 0x00);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITY_LSB, 0x00);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITZ_MSB, 0x00);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITZ_LSB, 0x00);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&amp;nbsp; &lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(A_VECM_CFG,0x78);&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(M_CTRL_REG1,((IIC_RegRead(M_CTRL_REG1))&amp;amp;(~0x03)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(M_CTRL_REG2,((IIC_RegRead(M_CTRL_REG2))&amp;amp;(~0x20)));&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;MMA865x_Active();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IntSource=IIC_RegRead(INT_SOURCE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;now I'm polling for &lt;/STRONG&gt;&lt;STRONG&gt;A_VECM &lt;/STRONG&gt;&lt;STRONG&gt;event&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #7ed529;"&gt; General_IntSource= IIC_RegRead(INT_SOURCE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt; if (General_IntSource&amp;amp;0x02) readdata();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and finally the function &lt;SPAN style="line-height: 1.5;"&gt;readdata()&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;void &lt;/SPAN&gt;&lt;SPAN style="color: #7ed529;"&gt;readdata&lt;/SPAN&gt;&lt;SPAN style="color: #7ed529;"&gt;(void)&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IntSource=IIC_RegRead(INT_SOURCE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt; MMA865x_Standby();&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt; IIC_RegWrite(M_CTRL_REG1,((IIC_RegRead(M_CTRL_REG1))|0x03));&amp;nbsp; //hybrid mode&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt; IIC_RegWrite(M_CTRL_REG2,((IIC_RegRead(M_CTRL_REG2))|0x20));&amp;nbsp; //enable magnetic auto increment&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt; IIC_RegWrite(CTRL_REG4,0x01);&amp;nbsp; //enable data ready interrupts and disable A_VECM interrupts&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt; MMA865x_Active();&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;//ACTIVATE THE SENSOR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;here I read several times the accelerometer and magnetic data using data ready interrupt to retrieve new data&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;after finalizing reading data I set the parameters to re-accept&amp;nbsp; &lt;SPAN style="line-height: 1.5;"&gt;A_VECM interrupts&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;MMA865x_Standby();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;IIC_RegWrite(CTRL_REG4,0x02);&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;//Disable Data Ready interrupts, enable A_VECM interrupts&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN style="line-height: 1.5;"&gt;for (i=0; i&amp;lt;60000; i++); &lt;SPAN style="color: #303030;"&gt;&lt;STRONG&gt;- if this line is removed the &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #303030;"&gt;&lt;STRONG style="line-height: 1.5;"&gt;A_VECM interrupt is not asserted anymore unless I restart the system&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;IIC_RegWrite(M_CTRL_REG1,((IIC_RegRead(M_CTRL_REG1))&amp;amp;(~0x03)));&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;//Enable Accelerometer_Only&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;&lt;SPAN style="line-height: 1.5;"&gt;IIC_RegWrite(M_CTRL_REG2,((IIC_RegRead(M_CTRL_REG2))&amp;amp;(~0x20)));&lt;/SPAN&gt;&lt;SPAN class="Apple-tab-span" style="line-height: 1.5; white-space: pre;"&gt; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;//Disable autoincrement mode&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;MMA865x_Active();&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;//ACTIVATE THE SENSOR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;IntSource=IIC_RegRead(INT_SOURCE);&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;//Read 0x0C INT_SOURCE register to clear the interrupt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7ed529;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;the first interrupt is always asserted and the system works as expected. i get all data readings.&lt;/P&gt;&lt;P&gt;when the delay line is placed also the system is working fine. the question is why is it needed at all.&lt;/P&gt;&lt;P&gt;i got the idea that the delay is needed because&amp;nbsp; i had there several lines of printing for the debugging. once i removed those lines i stopped getting interrupts after the first A_VECM.&lt;/P&gt;&lt;P&gt;after an investigation i made i realized that a delay after setting CTRL_ REG4 is required in order to get the successive interrupts.&lt;/P&gt;&lt;P&gt;i positively know the interrupt in no asserted because in debug mode i can see the&amp;nbsp; &lt;SPAN style="color: #7ed529; line-height: 1.5;"&gt;General_IntSource &lt;SPAN style="color: #303030;"&gt;variable get the value of 0x00.&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I would appreciate if you can look into this case and come with your insights.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Meir&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;MMA865x_Standby();&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(CTRL_REG4,0x02);&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(A_VECM_THS_MSB,0x80);&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(A_VECM_THS_LSB,Acc_THS);&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(A_VECM_CNT,Acc_COUNT);&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITX_MSB, 0x00);&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITX_LSB, 0x00);&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITY_MSB, 0x00);&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITY_LSB, 0x00);&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITZ_MSB, 0x00);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIC_RegWrite(A_VECM_INITZ_LSB, 0x00);&amp;nbsp; &lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(A_VECM_CFG,0x78);&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(M_CTRL_REG1,((IIC_RegRead(M_CTRL_REG1))&amp;amp;(~0x03)));&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IIC_RegWrite(M_CTRL_REG2,((IIC_RegRead(M_CTRL_REG2))&amp;amp;(~0x20)));&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;MMA865x_Active();&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;IntSource=IIC_RegRead(INT_SOURCE);&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 11:08:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/accelerometer-vector-magnitude/m-p/421409#M1910</guid>
      <dc:creator>meirsudry</dc:creator>
      <dc:date>2015-08-12T11:08:16Z</dc:date>
    </item>
  </channel>
</rss>

