<?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: LC60: Internal Temperature Sensor(AD26 value decreases when temperature increases) in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158524#M9334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;There may be&amp;nbsp;a misprint in the data sheet, but your equation is wrong. It should be:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;T = 25 - (Vtemp - 0.7013) / 0.0017&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If the temperature is above 25C, the last part will end up negative due to the way the temp sensor works.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Also, if it's like the QG8, there will be a different divisor (slope) for temps above and below 25C.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;ballen&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Oct 2007 22:55:20 GMT</pubDate>
    <dc:creator>ballen</dc:creator>
    <dc:date>2007-10-25T22:55:20Z</dc:date>
    <item>
      <title>LC60: Internal Temperature Sensor(AD26 value decreases when temperature increases)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158522#M9332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I want to measure&amp;nbsp;working temprature by using internal temperature sensor of LC60 to compensate deviation at external real-time crystal(32.768kHz) over temperature. Accuracy is not so important, +-5 C degree is enough for me.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The datasheet indicates an equation at page 268 (15.1.1.5 Temperature Sensor section):&lt;/DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;TempC = (Vtemp – 0.7013) ÷ (0.0017)&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;I recalculated 0.0017 value and found my calibrated divider instead of this value (only at 25 C degree).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The problem is here:&lt;/DIV&gt;&lt;DIV&gt;Measured Temperature is 25C at 25Cdegree room. OK&lt;/DIV&gt;&lt;DIV&gt;Measured Temperature is 15C at 35Cdegree room. ?&lt;/DIV&gt;&lt;DIV&gt;Measured Temperature is 35C at 18Cdegree room. ?&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;I'm using AD26 channel voltage as Vtemp.&amp;nbsp; Am I missing something?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks.&lt;/DIV&gt;&lt;DIV&gt;BP.&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by BasePointer on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2007-10-25&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;03:58 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:03:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158522#M9332</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2020-10-29T09:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: LC60: Internal Temperature Sensor(AD26 value decreases when temperature increases)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158523#M9333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;The range is -40C / +85C&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2007 22:18:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158523#M9333</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2007-10-25T22:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: LC60: Internal Temperature Sensor(AD26 value decreases when temperature increases)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158524#M9334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;There may be&amp;nbsp;a misprint in the data sheet, but your equation is wrong. It should be:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;T = 25 - (Vtemp - 0.7013) / 0.0017&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If the temperature is above 25C, the last part will end up negative due to the way the temp sensor works.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Also, if it's like the QG8, there will be a different divisor (slope) for temps above and below 25C.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;ballen&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2007 22:55:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158524#M9334</guid>
      <dc:creator>ballen</dc:creator>
      <dc:date>2007-10-25T22:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: LC60: Internal Temperature Sensor(AD26 value decreases when temperature increases)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158525#M9335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi ballen,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Yes, the LC60 datasheet misprinted. QG8 datasheet is good at this subject. I also learned that there is an application note AN3031 from the QG8.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you,&lt;/DIV&gt;&lt;DIV&gt;BP.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2007 13:54:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158525#M9335</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2007-10-26T13:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: LC60: Internal Temperature Sensor(AD26 value decreases when temperature increases)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158526#M9336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi again,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm only capable of making single point calibration.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;adc_temp: AD26 ADC value&lt;/DIV&gt;&lt;DIV&gt;adc_ref: AD27 ADC value&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;T(in C) = 25 - [(adc_temp*1.2/adc_ref) - Vtemp25] / m..................(1)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Which variable should&amp;nbsp;be recalculated by my calibration process&amp;nbsp;,&amp;nbsp;Vtemp25 or m?&lt;/DIV&gt;&lt;DIV&gt;Now, I'm using predefined m_cold(1.646mV/C), m_hot(1.769mV/C) and recalculated Vtemp25 value.&lt;/DIV&gt;&lt;DIV&gt;Is this method sufficient?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2007 19:08:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158526#M9336</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2007-10-26T19:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: LC60: Internal Temperature Sensor(AD26 value decreases when temperature increases)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158527#M9337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a sample code, not the best calibration, but gets your there....I did the calculations in millivolts...&lt;/P&gt;&lt;P&gt;you have to call these functions before hand:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ( AD1_Measure(TRUE) !=ERR_OK ){;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;AD1_GetValue16(&amp;amp;ADC_Values);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TemperatureFunction (&amp;amp;tempVariable);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define mhot&amp;nbsp;&amp;nbsp; &amp;nbsp;1.769&lt;BR /&gt;#define mcold &amp;nbsp;&amp;nbsp; &amp;nbsp;1.646&lt;BR /&gt;#define Vtemp25 701.2&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; //In milliVolts&lt;BR /&gt;&lt;BR /&gt;double Vtemp=0;&amp;nbsp;&amp;nbsp; //In milliVolts&lt;BR /&gt;void TemperatureFunction ( double *temp)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Vtemp&amp;nbsp; = 120&amp;nbsp; * (10*(double) ADC_Values [ ADC_TempSensor]) / (double)ADC_Values[ADC_Bandgap];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if ( Vtemp &amp;gt; Vtemp25 )&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(*temp) =&amp;nbsp; 25- ( (Vtemp- Vtemp25&amp;nbsp; )/mhot );&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}else&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(*temp) =&amp;nbsp; 25- ( (Vtemp - Vtemp25)/mcold );&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 08:27:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158527#M9337</guid>
      <dc:creator>Ashkan</dc:creator>
      <dc:date>2010-05-12T08:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: LC60: Internal Temperature Sensor(AD26 value decreases when temperature increases)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158528#M9338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello BP,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This subject was extensively discussed in your thread of a couple of years ago.&amp;nbsp; I suggest that you revisit that thread &lt;A __default_attr="40343" class="jive_macro jive_macro_thread default_title" href="https://community.freescale.com/thread/40343" jivemacro="thread" title="here"&gt;here&lt;/A&gt;.&amp;nbsp; The calculations shown in my posts towards the end of the thread would still be applicable.&amp;nbsp; These covered single point calibration where the calibration temperature was known, but other than 25C, and also&amp;nbsp;compensation for change of Vdd.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The temperature coefficient of the sensor is negative because it is simply the voltage accross a single diode that is measured.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 10:06:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-Internal-Temperature-Sensor-AD26-value-decreases-when/m-p/158528#M9338</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-05-12T10:06:43Z</dc:date>
    </item>
  </channel>
</rss>

