<?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: Temperature measurement with ADC  in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014887#M56161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Prashant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this is in your development board&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jan 2020 16:41:00 GMT</pubDate>
    <dc:creator>Alexis_A</dc:creator>
    <dc:date>2020-01-28T16:41:00Z</dc:date>
    <item>
      <title>Temperature measurement with ADC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014878#M56152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;I am using MK61FN1M0VMJ12 microcontroller. I am trying to read it's temperature with built in sensor with ADC CH 26.&amp;nbsp; But I get constant reading of 64875(ADC0_RA) in differential and value 64 when in single ended mode.&amp;nbsp;Same behavior is seen on CH 30.&amp;nbsp;Same piece of code I tested on my K60 Tower Kit and it is working there properly. Can u please tell me what I'm doing wrong. Here is the initialization code:&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;void init_adc(){&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;tADC_Config Master_Adc_Config;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;disable_irq(ADC0_irq_no) ;&amp;nbsp; &amp;nbsp;// not ready for this interrupt yet. Plug vector first.&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;disable_irq(72) ;&amp;nbsp; &amp;nbsp; // not ready for this interrupt yet. Plug vector first.&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; SIM_SCGC6 |= (SIM_SCGC6_ADC0_MASK );&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; SIM_SCGC6 |= SIM_SCGC6_PDB_MASK ;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;// Configure System Integration Module for defaults as far as ADC&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; SIM_SOPT7 &amp;amp;= ~(SIM_SOPT7_ADC0ALTTRGEN_MASK&amp;nbsp; | // selects PDB not ALT trigger&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SIM_SOPT7_ADC0PRETRGSEL_MASK );&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; SIM_SOPT7 = SIM_SOPT7_ADC0TRGSEL(0);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// applies only in case of ALT trigger, in which case&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; PDB0_SC =&amp;nbsp; PDB_SC_CONT_MASK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Contintuous, rather than one-shot, mode&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_SC_PDBEN_MASK&amp;nbsp; &amp;nbsp; &amp;nbsp; // PDB enabled&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;// &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_SC_PDBIE_MASK&amp;nbsp; &amp;nbsp; &amp;nbsp; // PDB Interrupt Enable&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_SC_PRESCALER(0x5)&amp;nbsp; // Slow down the period of the PDB for testing&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_SC_TRGSEL(0xf)&amp;nbsp; &amp;nbsp; &amp;nbsp;// Trigger source is Software Trigger to be invoked in this file&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_SC_MULT(2);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Multiplication factor 20 for the prescale divider for the counter clock&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // the software trigger, PDB_SC_SWTRIG_MASK is not triggered at this time.&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; PDB0_IDLY = 0x0000;&amp;nbsp; &amp;nbsp;// need to trigger interrupt every counter reset which happens when modulus reached&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; PDB0_MOD = 0xffff;&amp;nbsp; &amp;nbsp; // largest period possible with the slections above, so slow you can see each conversion.&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;// channel 0 pretrigger 0 and 1 enabled and delayed&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; PDB0_CH0C1 = PDB_C1_EN(0x01)&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_C1_TOS(0x01)&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_C1_EN(0x02)&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_C1_TOS(0x02) ;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; PDB0_CH0DLY0 = 0x2000 ;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; PDB0_CH0DLY1 = 0x4000 ;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; PDB0_SC =&amp;nbsp; PDB_SC_CONT_MASK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Contintuous, rather than one-shot, mode&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_SC_PDBEN_MASK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// PDB enabled&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;// &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_SC_PDBIE_MASK&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// PDB Interrupt Enable&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_SC_PRESCALER(0x5)&amp;nbsp; &amp;nbsp;// Slow down the period of the PDB for testing&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_SC_TRGSEL(0xf)&amp;nbsp; &amp;nbsp; &amp;nbsp; // Trigger source is Software Trigger to be invoked in this file&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_SC_MULT(2)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Multiplication factor 20 for the prescale divider for the counter clock&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| PDB_SC_LDOK_MASK;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Need to ok the loading or it will not load certain regsiters!&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// the software trigger, PDB_SC_SWTRIG_MASK is not triggered at this time.&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; Master_Adc_Config.CONFIG1&amp;nbsp; = ADLPC_NORMAL&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ADC_CFG1_ADIV(ADIV_4)&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ADLSMP_LONG&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ADC_CFG1_MODE(MODE_16)&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ADC_CFG1_ADICLK(ADICLK_BUS);&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; Master_Adc_Config.CONFIG2&amp;nbsp; = MUXSEL_ADCA&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ADACKEN_DISABLED&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ADHSC_HISPEED&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ADC_CFG2_ADLSTS(ADLSTS_20) ;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; Master_Adc_Config.STATUS2&amp;nbsp; = ADTRG_HW&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ACFE_DISABLED&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ACFGT_GREATER&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ACREN_ENABLED&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | DMAEN_DISABLED&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ADC_SC2_REFSEL(REFSEL_EXT);&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; Master_Adc_Config.STATUS3&amp;nbsp; = CAL_OFF&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ADCO_SINGLE&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | AVGE_ENABLED&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ADC_SC3_AVGS(AVGS_32);&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; Master_Adc_Config.PGA&amp;nbsp; &amp;nbsp; &amp;nbsp; = PGAEN_DISABLED&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | PGACHP_NOCHOP&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | PGALP_NORMAL&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | ADC_PGA_PGAG(PGAG_64);&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; Master_Adc_Config.STATUS1A = AIEN_OFF | DIFF_SINGLE | ADC_SC1_ADCH(31);&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; Master_Adc_Config.STATUS1B = AIEN_OFF | DIFF_SINGLE | ADC_SC1_ADCH(31);&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; ADC_Config_Alt(ADC0_BASE_PTR, &amp;amp;Master_Adc_Config);&amp;nbsp; // config ADC&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; ADC_Cal(ADC0_BASE_PTR);&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // do the calibration&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; Master_Adc_Config.STATUS1A = AIEN_ON | DIFF_SINGLE | ADC_SC1_ADCH(26);&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; Master_Adc_Config.STATUS1B = AIEN_ON | DIFF_SINGLE | ADC_SC1_ADCH(30);&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; ADC_Config_Alt(ADC0_BASE_PTR, &amp;amp;Master_Adc_Config);&amp;nbsp; // config ADC0&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; enable_irq(ADC0_irq_no) ;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; PDB0_SC |= PDB_SC_SWTRIG_MASK ;&amp;nbsp; &amp;nbsp; // kick off the PDB&amp;nbsp; - just once&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;void adc0_isr(void){&amp;nbsp;if (( ADC0_SC1A &amp;amp; ADC_SC1_COCO_MASK ) == ADC_SC1_COCO_MASK)&amp;nbsp;{&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; printf("ADC0A: %d\t",ADC0_RA);&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;}&amp;nbsp;else if (( ADC0_SC1B &amp;amp; ADC_SC1_COCO_MASK ) == ADC_SC1_COCO_MASK)&amp;nbsp;{&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp; printf("ADC0B: %d\r",ADC0_RB);&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;}}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jan 2020 08:58:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014878#M56152</guid>
      <dc:creator>prashantdev</dc:creator>
      <dc:date>2020-01-15T08:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Temperature measurement with ADC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014879#M56153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/prashantdev"&gt;prashantdev&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The temperature sensor should be only in the AD26 only and the AD31 mention that disable the module, if you want to do it single ended disable the SC1n[DIFF].&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/96869iBDF97E4661B8D750/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, for more information, check the following &lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN3031.pdf"&gt;document &lt;/A&gt;that explains how to convert the measurement to temperature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 21:46:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014879#M56153</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-01-17T21:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Temperature measurement with ADC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014880#M56154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thnx Alexis for ur reply.&lt;/P&gt;&lt;P&gt;I'm disabling the channel before calibration. After calibration I've enabled it again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jan 2020 08:13:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014880#M56154</guid>
      <dc:creator>prashantdev</dc:creator>
      <dc:date>2020-01-18T08:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Temperature measurement with ADC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014881#M56155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prashant D,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I reproduce this using Processor Expert and could succesfully obtain the measurement,&amp;nbsp;here's an example project of how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2020 14:27:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014881#M56155</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-01-22T14:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Temperature measurement with ADC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014882#M56156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for ur effort. Can u tell me if I'm doing something wrong in above posted code ? Because I've tested same code on different K61 microcontroller and behavior is same. Though when I run this code on my K60 tower kit it works. I don't know what I'm doing wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2020 03:57:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014882#M56156</guid>
      <dc:creator>prashantdev</dc:creator>
      <dc:date>2020-01-24T03:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Temperature measurement with ADC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014883#M56157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Prashant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you try other ADC modules (ADC1 / ADC2 / ADC3) or other channels to check if this behavior is the same?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2020 15:39:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014883#M56157</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-01-24T15:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Temperature measurement with ADC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014884#M56158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes it is same with all channels&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2020 17:10:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014884#M56158</guid>
      <dc:creator>prashantdev</dc:creator>
      <dc:date>2020-01-24T17:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Temperature measurement with ADC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014885#M56159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Prashant,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which voltage does it have&amp;nbsp;VREFH&amp;nbsp; and VREFL? Also do you have other MCU where you could test this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2020 21:12:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014885#M56159</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-01-24T21:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Temperature measurement with ADC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014886#M56160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It shows same value (64875) while reading VREFH and VREFL channel. My code works properly on K60N512VMD100 tower kit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jan 2020 18:50:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014886#M56160</guid>
      <dc:creator>prashantdev</dc:creator>
      <dc:date>2020-01-25T18:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Temperature measurement with ADC</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014887#M56161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Prashant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this is in your development board&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jan 2020 16:41:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Temperature-measurement-with-ADC/m-p/1014887#M56161</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2020-01-28T16:41:00Z</dc:date>
    </item>
  </channel>
</rss>

