<?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: Problem with ADC driver - freeze in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-ADC-driver-freeze/m-p/188469#M3499</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello vondrus,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this thread would fit into the kinetis section because it seems to be problem with MCU not MQX. I am running your example t to see if the conversation bit is not set in a while. I checked errata for your masket, there's only one problem with ADC and conversation abort. This example should work smoothly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Waht if you test to disable hardware avarage or lower conversation samples?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This conditon should check CALF bit in ADCx_SC3? You are checking the bit which you have already set. This does not have any impact to a problem though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  if(ADC1_SC3 &amp;amp; 0x4)  {    printf("Callibration ok \n");    }else  {    printf("Callibration failed \n");  }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:39:37 GMT</pubDate>
    <dc:creator>c0170</dc:creator>
    <dc:date>2020-10-29T09:39:37Z</dc:date>
    <item>
      <title>Problem with ADC driver - freeze</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-ADC-driver-freeze/m-p/188468#M3498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having a problem with ADC driver for K60 uP that is used by touch screen resistive driver in MQX 3.8.&lt;/P&gt;&lt;P&gt;The ADC driver stops sending the events to touch screen driver after some time (from minutes to days).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've written small test program that directly uses the ADC peripheral and I'm able to induce the situation when ADC does not signalize the conversion complete.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I shall note that I'm using PK version of uP (silicon 2N30D).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I'm using for the test:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void adc_task(uint_32 ini_data){  uint_16 set_gain;  //set calibration config adc:  SIM_SCGC3 |= 1 &amp;lt;&amp;lt;27; // on adc1 clock  ADC1_CFG1 = 0x64 ; // adc clock config  and resolution  ADC1_SC2 = 0x0; // select software trigger and power down compare function  ...  ADC1_SC3 = 0x07; // set max avereage  and continuos conversion    //run calibration:  ADC1_SC3 |= 1 &amp;lt;&amp;lt; 7;  //wait for callibration complete:  while(!(ADC1_SC1A &amp;amp; 0x80));  if(ADC1_SC3 &amp;amp; 0x4)  {    printf("Callibration ok \n");    }else  {    printf("Callibration failed \n");  }    //set plus /minus gain,   set_gain = ADC1_CLP0;  set_gain +=ADC1_CLP1;  set_gain +=ADC1_CLP2;  set_gain +=ADC1_CLP3;  set_gain +=ADC1_CLP4;    set_gain = set_gain / 2;  set_gain |= 1 &amp;lt;&amp;lt; 15;  ADC1_PG = set_gain;       set_gain = ADC1_CLM0;  set_gain +=ADC1_CLM1;  set_gain +=ADC1_CLM2;  set_gain +=ADC1_CLM3;  set_gain +=ADC1_CLM4;  set_gain = set_gain / 2;  set_gain |= 1 &amp;lt;&amp;lt; 15;  ADC1_MG = set_gain;    ADC1_SC1A = 0x1A; // select channel  - temperature sensor  while(1)  {    //conversion: - software trigger start conversion when write to sc1a register    ADC1_SC1A = 0x1A; // select channel  - temperature sensor    _time_delay(2);    while(!(ADC1_SC1A &amp;amp; 0x80)) //wait for complete    {    }    _time_delay(2);  }    }&lt;/PRE&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ondra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:39:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-ADC-driver-freeze/m-p/188468#M3498</guid>
      <dc:creator>vondrus</dc:creator>
      <dc:date>2020-10-29T09:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with ADC driver - freeze</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-ADC-driver-freeze/m-p/188469#M3499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello vondrus,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this thread would fit into the kinetis section because it seems to be problem with MCU not MQX. I am running your example t to see if the conversation bit is not set in a while. I checked errata for your masket, there's only one problem with ADC and conversation abort. This example should work smoothly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Waht if you test to disable hardware avarage or lower conversation samples?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This conditon should check CALF bit in ADCx_SC3? You are checking the bit which you have already set. This does not have any impact to a problem though.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  if(ADC1_SC3 &amp;amp; 0x4)  {    printf("Callibration ok \n");    }else  {    printf("Callibration failed \n");  }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:39:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Problem-with-ADC-driver-freeze/m-p/188469#M3499</guid>
      <dc:creator>c0170</dc:creator>
      <dc:date>2020-10-29T09:39:37Z</dc:date>
    </item>
  </channel>
</rss>

