<?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>LPC MicrocontrollersのトピックRe: LPC55S69 internal temperature sensor</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1352514#M46665</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;A id="link_27" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192074" target="_self" aria-label="View Profile of Fastfox"&gt;&lt;SPAN class=""&gt;Fastfox&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;Yes, the&amp;nbsp;&amp;nbsp;temperature accuracy is&amp;nbsp;+/- 4 C.&lt;/P&gt;
&lt;P&gt;And I test the SDK demo&amp;nbsp;lpcxpresso55s69_lpadc_temperature_measurement on LPCxpresso55s69 demo board, the temperature result is the same:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alice_Yang_0-1633681712680.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/158601iFB3D7001587C8D34/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alice_Yang_0-1633681712680.png" alt="Alice_Yang_0-1633681712680.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Oct 2021 08:30:31 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2021-10-08T08:30:31Z</dc:date>
    <item>
      <title>LPC55S69 internal temperature sensor</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1351018#M46646</link>
      <description>&lt;P&gt;I am trying to read MCU temperature with the example I found from SDK(lpadc_temperature_measurement). When I run the measurement approximately once/s, result seems to toggle between two values that are 3.5C degrees apart from each other. ADC results are not changing that much, but final temperature is. I tried to compare the example formula to what the datasheet says and I also replicated the formula to libre calc and the results are the same. Changing the ADC result with just one bit, changes to output several degrees. Example output:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0x147E(5246) Shifted:0x28F&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0x161A(5658) Shifted:0x2C3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Temp: 27.504&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;0x147E(5246) Shifted:0x28F&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0x161B(5659) Shifted:0x2C3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Temp: 27.504&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;0x1481(5249) Shifted:0x290&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0x161D(5661) Shifted:0x2C3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Temp: 23.917&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;0x1483(5251) Shifted:0x290&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0x161F(5663) Shifted:0x2C3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Temp: 23.917&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;0x1484(5252) Shifted:0x290&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0x161F(5663) Shifted:0x2C3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Temp: 23.917&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;0x1485(5253) Shifted:0x290&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0x161E(5662) Shifted:0x2C3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Temp: 23.917&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;0x1485(5253) Shifted:0x290&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0x1620(5664) Shifted:0x2C4&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Temp: 27.242&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Read it like this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;ADC_conv_result1_hex(ADC_conv_result1_dec) Shifted:3bit_shifted_result1_hex&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ADC_conv_result2_hex(ADC_conv_result2_dec) Shifted:3bit_shifted_result2_hex&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Temp: Output of the formula&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;So feeding e.g. 0x28F and 0x2C3 to the formula gives 23.917C and feeding 0x290 and 0x2C3 gives 27.242.&lt;/P&gt;&lt;P&gt;My question is that is this really the accuracy that one should expect or is the calculation in example and in datasheet somehow incorrect?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 09:18:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1351018#M46646</guid>
      <dc:creator>Fastfox</dc:creator>
      <dc:date>2021-10-06T09:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 internal temperature sensor</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1351127#M46648</link>
      <description>&lt;P&gt;Without knowing details about the internal sensor, nor the SDK code, the following thing catched my eye:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;0x147E(5246) Shifted:&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;0x28F&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0x161B(5659) Shifted:0x2C3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Temp: 27.504&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;0x1481(5249) Shifted:&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0x290&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;0x161D(5661) Shifted:0x2C3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Temp: 23.917&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;This is just one LSB difference, which would at least be normal for a ADC channel.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 12:31:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1351127#M46648</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-10-06T12:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 internal temperature sensor</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1351212#M46649</link>
      <description>&lt;P&gt;I wouldn’t expect 1 bit to change it so much, so either the formula, or your interpretation of it, is incorrect. Perhaps you could post your code?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 14:08:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1351212#M46649</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2021-10-06T14:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 internal temperature sensor</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1351625#M46653</link>
      <description>&lt;P&gt;Here is the code. This is not exactly "my code", but straight from the SDK example.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;float DEMO_MeasureTemperature(ADC_Type *base, uint32_t commandId, uint32_t index)
{
	g_LpadcConversionCompletedFlag = false;
    lpadc_conv_result_t convResultStruct;
    uint16_t Vbe1            = 0U;
    uint16_t Vbe8            = 0U;
    uint32_t convResultShift = 3U;
    float parameterSlope     = DEMO_LPADC_TEMP_PARAMETER_A;
    float parameterOffset    = DEMO_LPADC_TEMP_PARAMETER_B;
    float parameterAlpha     = DEMO_LPADC_TEMP_PARAMETER_ALPHA;
    float temperature        = -273.15f; /* Absolute zero degree as the incorrect return value. */

#if defined(FSL_FEATURE_LPADC_TEMP_SENS_BUFFER_SIZE) &amp;amp;&amp;amp; (FSL_FEATURE_LPADC_TEMP_SENS_BUFFER_SIZE == 4U)
    /* For best temperature measure performance, the recommended LOOP Count should be 4, but the first two results is
     * useless. */
    /* Drop the useless result. */
    (void)LPADC_GetConvResult(base, &amp;amp;convResultStruct, (uint8_t)index);
    (void)LPADC_GetConvResult(base, &amp;amp;convResultStruct, (uint8_t)index);
#endif /* FSL_FEATURE_LPADC_TEMP_SENS_BUFFER_SIZE */

    /* Read the 2 temperature sensor result. */
    if (true == LPADC_GetConvResult(base, &amp;amp;convResultStruct, (uint8_t)index))
    {
        Vbe1 = convResultStruct.convValue &amp;gt;&amp;gt; convResultShift;
        //PRINTF("0x%02X(%u) Shifted:0x%02X\r\n", convResultStruct.convValue, convResultStruct.convValue, Vbe1);
        if (true == LPADC_GetConvResult(base, &amp;amp;convResultStruct, (uint8_t)index))
        {
            Vbe8 = convResultStruct.convValue &amp;gt;&amp;gt; convResultShift;
            //PRINTF("0x%02X(%u) Shifted:0x%02X\r\n", convResultStruct.convValue, convResultStruct.convValue, Vbe8);
            /* Final temperature = A*[alpha*(Vbe8-Vbe1)/(Vbe8 + alpha*(Vbe8-Vbe1))] - B. */
            temperature = parameterSlope * (parameterAlpha * ((float)Vbe8 - (float)Vbe1) /
                                            ((float)Vbe8 + parameterAlpha * ((float)Vbe8 - (float)Vbe1))) -
                          parameterOffset;
        }
    }
    //PRINTF("Temp: %6.3f\r\n", temperature);
    return temperature;
}&lt;/LI-CODE&gt;&lt;P&gt;Now I did notice from LPC55S69 manual, chapter 39.7.6 Temperature sensor:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;4. Depending on the device revision, following Alpha., A and B values are needed to&lt;BR /&gt;achieve &lt;EM&gt;&lt;STRONG&gt;+/- 4 C temperature accuracy.&lt;/STRONG&gt;&lt;/EM&gt; For device revision 0A: Alpha=9.5, A=770 and&lt;BR /&gt;B = 289.4. For device revision 1B: Alpha= 8.5, A=804 and B = 280.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So maybe it indeed is normal that you get +-4C difference while the actual temperature remains the same. SDK given values are something different though.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/* @brief Temperature sensor parameter A (slope). */
#define FSL_FEATURE_LPADC_TEMP_PARAMETER_A (744.6f)
/* @brief Temperature sensor parameter B (offset). */
#define FSL_FEATURE_LPADC_TEMP_PARAMETER_B (313.7f)
/* @brief Temperature sensor parameter Alpha. */
#define FSL_FEATURE_LPADC_TEMP_PARAMETER_ALPHA (11.5f)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I must say that this is the most unclear temperature measurement that I have ever seen &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 05:20:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1351625#M46653</guid>
      <dc:creator>Fastfox</dc:creator>
      <dc:date>2021-10-07T05:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 internal temperature sensor</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1352514#M46665</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;A id="link_27" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192074" target="_self" aria-label="View Profile of Fastfox"&gt;&lt;SPAN class=""&gt;Fastfox&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;Yes, the&amp;nbsp;&amp;nbsp;temperature accuracy is&amp;nbsp;+/- 4 C.&lt;/P&gt;
&lt;P&gt;And I test the SDK demo&amp;nbsp;lpcxpresso55s69_lpadc_temperature_measurement on LPCxpresso55s69 demo board, the temperature result is the same:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alice_Yang_0-1633681712680.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/158601iFB3D7001587C8D34/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Alice_Yang_0-1633681712680.png" alt="Alice_Yang_0-1633681712680.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 08:30:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1352514#M46665</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2021-10-08T08:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 internal temperature sensor</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1352556#M46666</link>
      <description>&lt;P&gt;I did not work with the LPC55S MCUs yet, but that does not make much sense to me. At least comparing with other internal temprature sensors.&lt;/P&gt;&lt;P&gt;The operating temperature range of the MCU is specified as -40...+105°C, giving about 145/4 = 38,5 steps, i.e. about 5 bit.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 08:59:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-internal-temperature-sensor/m-p/1352556#M46666</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2021-10-08T08:59:39Z</dc:date>
    </item>
  </channel>
</rss>

