<?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>SensorsのトピックRe: MPL3115A2 - Error reading altitude</title>
    <link>https://community.nxp.com/t5/Sensors/MPL3115A2-Error-reading-altitude/m-p/410345#M1736</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michele,&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;What you are reading is correct. If you convert 0xFFC5C0 to a signed fractional 20-bit value in meters, you will get about &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;-58.25 meters. &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;As you can see in my &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-101371"&gt;example project&lt;/A&gt;, you should use something like this:&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: Consolas; color: black;"&gt;Altitude = (&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;&lt;STRONG&gt;float&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;) ((&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;&lt;STRONG&gt;short&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;) ((OUT_P_MSB_REG &amp;lt;&amp;lt; 8) | OUT_P_CSB_REG )) + (&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;&lt;STRONG&gt;float&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;) (OUT_P_LSB_REG&amp;nbsp; &amp;gt;&amp;gt; 4) * 0.0625;&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;For information on how the MPL3115A2 internally calculates altitude, please look at the &lt;A href="http://cache.freescale.com/files/sensors/doc/app_note/AN4528.pdf"&gt;AN4528&lt;/A&gt; or &lt;A href="http://blogs.freescale.com/sensors/2011/07/xtrinsic-pressure-sensor-altimeter-part-1/"&gt;this&lt;/A&gt; article. As you can notice, the calculated altitude is negative if the measured pressure is higher than 1013.26 hPa, which is the default pressure reference at sea level stored in the &lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif;"&gt;BAR_IN_MSB (0x14) and BAR_IN_LSB (0x15) registers&lt;/SPAN&gt;.&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;To adjust the most precise altitude, I recommend the following:&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;1. If you know your current position and the altitude using some external calibration point in meters, then adjust the OFF_H register (0x2D) to account for the discrepancy.&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;2. If you would like to adjust to weather changes, the BAR_IN_MSB and BAR_IN_LSB registers allow you to modify the default pressure value (1013.26 hPa) that internally is used in the equation that converts pressure in Pascals to meters for altitude, as mentioned above. So if there is a very stormy day and your local weather/airport gives the pressure normalized for sea level, this value should go into these registers. This should bring the height closer and additional will require the OFF_H adjustment.&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;I hope it helps.&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="color: #333333; font-size: 13px; font-family: Arial, sans-serif;"&gt;&lt;EM&gt;&lt;SPAN style="color: #3d3d3d; font-style: inherit; font-size: 11px; font-family: inherit; font-weight: inherit;"&gt;&lt;EM&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" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;I&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 11px; font-family: inherit; color: #3d3d3d;"&gt;f 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>Wed, 15 Apr 2015 13:45:30 GMT</pubDate>
    <dc:creator>TomasVaverka</dc:creator>
    <dc:date>2015-04-15T13:45:30Z</dc:date>
    <item>
      <title>MPL3115A2 - Error reading altitude</title>
      <link>https://community.nxp.com/t5/Sensors/MPL3115A2-Error-reading-altitude/m-p/410344#M1735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to read altitude data from MPL3115A2 but I'm stuck into a strange error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm able to read and write values on registers trough I2C interface indeed I can read correctly the ID value (&lt;SPAN style="font-size: 13.3333330154419px;"&gt;0x&lt;/SPAN&gt;C4) and I'm also able to write and read back values from any other registers (test made on CTRL_REG1, PT_DATA_CFG).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm following the Quick Setup procedure in MPL3115A2 &lt;SPAN style="font-size: 13.3333330154419px;"&gt;datasheet (pag 10, polling mode) I collected the values from:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;OUT_P_MSB,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;OUT_P_CSB, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;OUT_P_LSB, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;OUT_T_MSB, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;OUT_T_LSB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The OUT_T_xx values seems correct since they can be converted to a float value around 24 degrees (that's a reasonable temperature value in the test environment).&lt;/P&gt;&lt;P&gt;The problem arise with OUT_P_xxx values . OUT_P_MSB is always set to 0xFF value ... I've not investigated yet trough oscilloscope but it seems like the IC it's &lt;/P&gt;&lt;P&gt;not correctly replying to the read request (but just for the first byte value since CSB and LSB values are not fixed but variates around a steady value).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Typical values collected from T registers are: 0x18A0&lt;/P&gt;&lt;P&gt;Typical values collected from P registers are: 0xFFC5C0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Michele Santucci&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2026 21:04:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MPL3115A2-Error-reading-altitude/m-p/410344#M1735</guid>
      <dc:creator>michelesantucci</dc:creator>
      <dc:date>2026-02-03T21:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: MPL3115A2 - Error reading altitude</title>
      <link>https://community.nxp.com/t5/Sensors/MPL3115A2-Error-reading-altitude/m-p/410345#M1736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michele,&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;What you are reading is correct. If you convert 0xFFC5C0 to a signed fractional 20-bit value in meters, you will get about &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;-58.25 meters. &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;As you can see in my &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-101371"&gt;example project&lt;/A&gt;, you should use something like this:&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: Consolas; color: black;"&gt;Altitude = (&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;&lt;STRONG&gt;float&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;) ((&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;&lt;STRONG&gt;short&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;) ((OUT_P_MSB_REG &amp;lt;&amp;lt; 8) | OUT_P_CSB_REG )) + (&lt;/SPAN&gt;&lt;SPAN style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;&lt;STRONG&gt;float&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;) (OUT_P_LSB_REG&amp;nbsp; &amp;gt;&amp;gt; 4) * 0.0625;&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;For information on how the MPL3115A2 internally calculates altitude, please look at the &lt;A href="http://cache.freescale.com/files/sensors/doc/app_note/AN4528.pdf"&gt;AN4528&lt;/A&gt; or &lt;A href="http://blogs.freescale.com/sensors/2011/07/xtrinsic-pressure-sensor-altimeter-part-1/"&gt;this&lt;/A&gt; article. As you can notice, the calculated altitude is negative if the measured pressure is higher than 1013.26 hPa, which is the default pressure reference at sea level stored in the &lt;SPAN style="color: #3d3d3d; font-family: Arial, sans-serif;"&gt;BAR_IN_MSB (0x14) and BAR_IN_LSB (0x15) registers&lt;/SPAN&gt;.&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;To adjust the most precise altitude, I recommend the following:&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;1. If you know your current position and the altitude using some external calibration point in meters, then adjust the OFF_H register (0x2D) to account for the discrepancy.&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;2. If you would like to adjust to weather changes, the BAR_IN_MSB and BAR_IN_LSB registers allow you to modify the default pressure value (1013.26 hPa) that internally is used in the equation that converts pressure in Pascals to meters for altitude, as mentioned above. So if there is a very stormy day and your local weather/airport gives the pressure normalized for sea level, this value should go into these registers. This should bring the height closer and additional will require the OFF_H adjustment.&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;I hope it helps.&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="color: #333333; font-size: 13px; font-family: Arial, sans-serif;"&gt;&lt;EM&gt;&lt;SPAN style="color: #3d3d3d; font-style: inherit; font-size: 11px; font-family: inherit; font-weight: inherit;"&gt;&lt;EM&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" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="Apple-converted-space"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;I&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 11px; font-family: inherit; color: #3d3d3d;"&gt;f 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>Wed, 15 Apr 2015 13:45:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MPL3115A2-Error-reading-altitude/m-p/410345#M1736</guid>
      <dc:creator>TomasVaverka</dc:creator>
      <dc:date>2015-04-15T13:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: MPL3115A2 - Error reading altitude</title>
      <link>https://community.nxp.com/t5/Sensors/MPL3115A2-Error-reading-altitude/m-p/410346#M1737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo Tomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the reply. It looks like it's working . I'have some doubt about reading results after the BAR_IN offset registration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2015 11:13:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MPL3115A2-Error-reading-altitude/m-p/410346#M1737</guid>
      <dc:creator>michelesantucci</dc:creator>
      <dc:date>2015-04-23T11:13:48Z</dc:date>
    </item>
  </channel>
</rss>

