<?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: What is the conversion factor the temperature on K64? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-is-the-conversion-factor-the-temperature-on-K64/m-p/1132762#M57935</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Here is the temperature sensor code used in the uTasker project (sample in results.sADC_value[0] - 12 bit mode) and resulting temperature in °C in slTemperature100:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;fnDebugHex(results.sADC_value[0], (WITH_SPACE | WITH_LEADIN | WITH_CR_LF | sizeof(results.sADC_value[0])));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define VTEMP_25_16BIT ((VTEMP_25_MV * 0xffff) / ADC_REFERENCE_VOLTAGE)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define VTEMP_25_12BIT (VTEMP_25_16BIT &amp;gt;&amp;gt; 4)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define VTEMP_25_10BIT (VTEMP_25_16BIT &amp;gt;&amp;gt; 6)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define TEMP_SENSOR_SLOPE_100_16BIT ((TEMP_SENSOR_SLOPE_UV * 0xffff)/(10 * ADC_REFERENCE_VOLTAGE))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define TEMP_SENSOR_SLOPE_100_12BIT (TEMP_SENSOR_SLOPE_100_16BIT &amp;gt;&amp;gt; 4)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define TEMP_SENSOR_SLOPE_100_10BIT (TEMP_SENSOR_SLOPE_100_16BIT &amp;gt;&amp;gt; 6)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;if (ADC_TRIGGER == ucInputMessage[MSG_INTERRUPT_EVENT]) { // convert the ADC reading to a temperature&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;signed short ssDifference = (results.sADC_value[0] - VTEMP_25_12BIT); // convert references to 12 bit values&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;signed long slTemperature100 = (2550 - ((ssDifference * 10000) / TEMP_SENSOR_SLOPE_100_12BIT)); // the approximate temperature * 100, rounded up/down&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;slTemperature100 /= 100; // the approximate temperature rounded up/down to 1°C&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;fnDebugDec(slTemperature100, DISPLAY_NEGATIVE);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;fnDebugMsg(" degC\r\n");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;where (for K64 and most such types)&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#define VTEMP_25_MV 716 // typical internal temperature sensor reference voltage (in mV) (3.3V VDD/VREF and &amp;lt; 3MHz ADC clock speed)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define TEMP_SENSOR_SLOPE_UV 1620 // typical internal temperature sensor slope uV/°C (3.3V VDD/VREF and &amp;lt; 3MHz ADC clock speed)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;from the K64 data sheet Table 31.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mjbcswitzerland_0-1598920578253.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/123776i433161041EA30F51/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mjbcswitzerland_0-1598920578253.png" alt="mjbcswitzerland_0-1598920578253.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mark&lt;BR /&gt;&lt;EM&gt;[uTasker project developer for Kinetis and i.MX RT]&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Sep 2020 00:36:32 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2020-09-01T00:36:32Z</dc:date>
    <item>
      <title>What is the conversion factor the temperature on K64?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-is-the-conversion-factor-the-temperature-on-K64/m-p/1077660#M57443</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 am using MK64FN1M0 and I am reading the temperature via ADC. Does anybody know what the conversion factor 'M' in Figure35-93 in the K64P144M120SF5RM manual is? Section 35.4.8 also mentioned use the Vtemp25 and 'M' values from the ADC Electrical table, where can I find this ADC Electicals table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the example in AN3031, the bandgap voltage always returns a different value, so Vdd changes everytime, which it shouldn't. Any idea how I can troubleshoot this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Aug 2020 21:36:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-is-the-conversion-factor-the-temperature-on-K64/m-p/1077660#M57443</guid>
      <dc:creator>dalim</dc:creator>
      <dc:date>2020-08-28T21:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: What is the conversion factor the temperature on K64?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-is-the-conversion-factor-the-temperature-on-K64/m-p/1132762#M57935</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Here is the temperature sensor code used in the uTasker project (sample in results.sADC_value[0] - 12 bit mode) and resulting temperature in °C in slTemperature100:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;fnDebugHex(results.sADC_value[0], (WITH_SPACE | WITH_LEADIN | WITH_CR_LF | sizeof(results.sADC_value[0])));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define VTEMP_25_16BIT ((VTEMP_25_MV * 0xffff) / ADC_REFERENCE_VOLTAGE)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define VTEMP_25_12BIT (VTEMP_25_16BIT &amp;gt;&amp;gt; 4)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define VTEMP_25_10BIT (VTEMP_25_16BIT &amp;gt;&amp;gt; 6)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define TEMP_SENSOR_SLOPE_100_16BIT ((TEMP_SENSOR_SLOPE_UV * 0xffff)/(10 * ADC_REFERENCE_VOLTAGE))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define TEMP_SENSOR_SLOPE_100_12BIT (TEMP_SENSOR_SLOPE_100_16BIT &amp;gt;&amp;gt; 4)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define TEMP_SENSOR_SLOPE_100_10BIT (TEMP_SENSOR_SLOPE_100_16BIT &amp;gt;&amp;gt; 6)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;if (ADC_TRIGGER == ucInputMessage[MSG_INTERRUPT_EVENT]) { // convert the ADC reading to a temperature&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;signed short ssDifference = (results.sADC_value[0] - VTEMP_25_12BIT); // convert references to 12 bit values&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;signed long slTemperature100 = (2550 - ((ssDifference * 10000) / TEMP_SENSOR_SLOPE_100_12BIT)); // the approximate temperature * 100, rounded up/down&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;slTemperature100 /= 100; // the approximate temperature rounded up/down to 1°C&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;fnDebugDec(slTemperature100, DISPLAY_NEGATIVE);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;fnDebugMsg(" degC\r\n");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;where (for K64 and most such types)&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;#define VTEMP_25_MV 716 // typical internal temperature sensor reference voltage (in mV) (3.3V VDD/VREF and &amp;lt; 3MHz ADC clock speed)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;#define TEMP_SENSOR_SLOPE_UV 1620 // typical internal temperature sensor slope uV/°C (3.3V VDD/VREF and &amp;lt; 3MHz ADC clock speed)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;from the K64 data sheet Table 31.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mjbcswitzerland_0-1598920578253.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/123776i433161041EA30F51/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mjbcswitzerland_0-1598920578253.png" alt="mjbcswitzerland_0-1598920578253.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mark&lt;BR /&gt;&lt;EM&gt;[uTasker project developer for Kinetis and i.MX RT]&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2020 00:36:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/What-is-the-conversion-factor-the-temperature-on-K64/m-p/1132762#M57935</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-09-01T00:36:32Z</dc:date>
    </item>
  </channel>
</rss>

