<?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 How to get 14 bit data from MMA8451Q Accelerometer ? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-get-14-bit-data-from-MMA8451Q-Accelerometer/m-p/277248#M10035</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;I want to extract 14 bit data out of MMA8451Q Accelerometer and display it over UART. So for storing I am taking &lt;STRONG style="font-size: 14pt;"&gt;int16_t&amp;nbsp; x, y, z;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; the maximum value which I am getting out is &lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;23736 &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;instead of permissible value &lt;STRONG style="font-size: 12pt;"&gt;2^14 = 16384&lt;/STRONG&gt;. and the minimum value which I am getting out is &lt;STRONG style="font-size: 12pt;"&gt;-17736&lt;/STRONG&gt; instead of the permissible value &lt;STRONG style="font-size: 12pt;"&gt;-&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;16384&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;. I am using FRDM-K20D50M board and the accelerometer is mounted on it. I am using codewarrior with processor expert. I am using MMA8451Q library in processor expert and extracting data using &lt;STRONG style="font-size: 12pt;"&gt;x=MMA1_GetX(); &lt;/STRONG&gt;or &lt;STRONG style="font-size: 12pt;"&gt;x=MMA1_MeasureGetRawX();&amp;nbsp; &lt;/STRONG&gt;Kindly look into the matter. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Amit Kumar&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Nov 2013 08:00:03 GMT</pubDate>
    <dc:creator>Amit_Kumar1</dc:creator>
    <dc:date>2013-11-14T08:00:03Z</dc:date>
    <item>
      <title>How to get 14 bit data from MMA8451Q Accelerometer ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-get-14-bit-data-from-MMA8451Q-Accelerometer/m-p/277248#M10035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;I want to extract 14 bit data out of MMA8451Q Accelerometer and display it over UART. So for storing I am taking &lt;STRONG style="font-size: 14pt;"&gt;int16_t&amp;nbsp; x, y, z;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; the maximum value which I am getting out is &lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;23736 &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;instead of permissible value &lt;STRONG style="font-size: 12pt;"&gt;2^14 = 16384&lt;/STRONG&gt;. and the minimum value which I am getting out is &lt;STRONG style="font-size: 12pt;"&gt;-17736&lt;/STRONG&gt; instead of the permissible value &lt;STRONG style="font-size: 12pt;"&gt;-&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;16384&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;. I am using FRDM-K20D50M board and the accelerometer is mounted on it. I am using codewarrior with processor expert. I am using MMA8451Q library in processor expert and extracting data using &lt;STRONG style="font-size: 12pt;"&gt;x=MMA1_GetX(); &lt;/STRONG&gt;or &lt;STRONG style="font-size: 12pt;"&gt;x=MMA1_MeasureGetRawX();&amp;nbsp; &lt;/STRONG&gt;Kindly look into the matter. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Amit Kumar&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 08:00:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-get-14-bit-data-from-MMA8451Q-Accelerometer/m-p/277248#M10035</guid>
      <dc:creator>Amit_Kumar1</dc:creator>
      <dc:date>2013-11-14T08:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 14 bit data from MMA8451Q Accelerometer ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-get-14-bit-data-from-MMA8451Q-Accelerometer/m-p/277249#M10036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I also tried &lt;STRONG&gt;printf("%d %d %d \n",MMA1_GetX(),MMA1_GetY(), MMA1_GetZ()); &lt;/STRONG&gt;and the maximum&amp;nbsp; values I got was &lt;STRONG&gt;17408, 15256, 17808 &lt;/STRONG&gt;and the minimum values I got was &lt;STRONG&gt;-16384, -16584, -16408 &lt;/STRONG&gt;for x,y,z respectively, But the value for 14 bit data should range b/w &lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;16384 to &lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;-&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;16384&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; So i was wondering is it due to the drift in accelerometer?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Amit Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 08:09:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-get-14-bit-data-from-MMA8451Q-Accelerometer/m-p/277249#M10036</guid>
      <dc:creator>Amit_Kumar1</dc:creator>
      <dc:date>2013-11-14T08:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 14 bit data from MMA8451Q Accelerometer ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-get-14-bit-data-from-MMA8451Q-Accelerometer/m-p/277250#M10037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, it has been a while... Did you get the answer?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 16:32:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-get-14-bit-data-from-MMA8451Q-Accelerometer/m-p/277250#M10037</guid>
      <dc:creator>alissonporto</dc:creator>
      <dc:date>2014-11-13T16:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 14 bit data from MMA8451Q Accelerometer ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-get-14-bit-data-from-MMA8451Q-Accelerometer/m-p/277251#M10038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alisson&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It has been a year now. The data being stored in 16 bit data type so to get 14 bit u need to bit shift the received data 2 times. i.e &lt;STRONG&gt;acc_x &amp;gt;&amp;gt; 2; &lt;/STRONG&gt;for all x,y,z values. An alternative solution can be dividing the raw 16 bit value by 4. i.e 2^2(on dividing 2^16 by 2^2 u will get 2^14 bit value i.e 14 bit value which we need but in this case the fluctuation in value is observed more.Hope It helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 09:57:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-get-14-bit-data-from-MMA8451Q-Accelerometer/m-p/277251#M10038</guid>
      <dc:creator>Amit_Kumar1</dc:creator>
      <dc:date>2014-11-14T09:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get 14 bit data from MMA8451Q Accelerometer ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-get-14-bit-data-from-MMA8451Q-Accelerometer/m-p/277252#M10039</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In mma8451q registers, both OUT_X_MSB[7:0] and OUT_X_LSB[7:2] indicates value of X.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You have to read OUT_X_MSB and OUT_X_LSB, and get X value by (OUT_X_MSB &amp;lt;&amp;lt; 6) | (OUT_X_LSB &amp;gt;&amp;gt; 2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Terry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Nov 2014 08:18:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-get-14-bit-data-from-MMA8451Q-Accelerometer/m-p/277252#M10039</guid>
      <dc:creator>terry_lv</dc:creator>
      <dc:date>2014-11-27T08:18:35Z</dc:date>
    </item>
  </channel>
</rss>

