<?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>Processor Expert SoftwareのトピックRe: ADC conversion does not complete</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394334#M3083</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the delay in replying. I attach the application for the analysis. Relevant code is in Events.c (line 148) and app.c (line 75). I've disabled the &lt;EM&gt;&lt;EM&gt;OnMeasurementComplete event &lt;/EM&gt;&lt;/EM&gt;in the ADC_LDD component but it does not solve the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;gaston&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Sep 2015 07:40:03 GMT</pubDate>
    <dc:creator>gschelotto</dc:creator>
    <dc:date>2015-09-01T07:40:03Z</dc:date>
    <item>
      <title>ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394325#M3074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've configured 5 ADC0 channels (ADC interrupt disabled) on KE02Z+KDS v3.0 as shown:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Untitled.png"&gt;&lt;IMG alt="Untitled.png" src="https://community.nxp.com/t5/image/serverpage/image-id/55465i830740B7502616CD/image-size/large?v=v2&amp;amp;px=999" title="Untitled.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and defined 2 groups (1st of channel 0 and 2nd of channel 1 to 4)&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Untitled2.png"&gt;&lt;IMG alt="Untitled2.png" src="https://community.nxp.com/t5/image/serverpage/image-id/55484iDEEE644F855230EE/image-size/large?v=v2&amp;amp;px=999" title="Untitled2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The goal is to get 1 ADC channel sample every 1ms (timer0 triggered) and 4 ADC channel samples every 10ms (timer1 triggered). Here's the initialization code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_14381661276197222 jive_macro_code jive_text_macro" data-renderedposition="761_8_1232_64" jivemacro_uid="_14381661276197222" modifiedtitle="true"&gt;&lt;P&gt;LDD_ADC_TSample samplegroup[AD1_CHANNEL_COUNT] = {AD1_ADC0_SE2, AD1_ADC0_SE0, AD1_ADC0_SE1, AD1_ADC0_SE3, AD1_ADC0_SE6};&lt;/P&gt;&lt;P&gt;word acqValueGroup0[AD1_STATIC_GROUP_0_SAMPLE_COUNT];&lt;/P&gt;&lt;P&gt;word acqValueGroup1[AD1_STATIC_GROUP_1_SAMPLE_COUNT];&lt;/P&gt;&lt;P&gt;AD1_CreateSampleGroup(AD1_DeviceData, samplegroup, AD1_CHANNEL_COUNT);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the first ADC channel (Timer0 ISR):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_14381661784431272 jive_macro_code jive_text_macro" data-renderedposition="888_8_1232_64" jivemacro_uid="_14381661784431272"&gt;&lt;P&gt;AD1_SelectSampleGroup(AD1_DeviceData, 0U);&lt;/P&gt;&lt;P&gt;AD1_StartSingleMeasurement(AD1_DeviceData);&lt;/P&gt;&lt;P&gt;while (!AD1_GetMeasurementCompleteStatus(AD1_DeviceData)) {}; // Wait for conversion completeness&lt;/P&gt;&lt;P&gt;AD1_GetMeasuredValues(AD1_DeviceData, acqValueGroup0);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for the left 4 channels (Timer1 ISR):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14381657840548776" data-renderedposition="1015_8_1232_64" jivemacro_uid="_14381657840548776" modifiedtitle="true"&gt;&lt;P&gt;AD1_SelectSampleGroup(AD1_DeviceData, 1U);&lt;/P&gt;&lt;P&gt;AD1_StartSingleMeasurement(AD1_DeviceData);&lt;/P&gt;&lt;P&gt;while (!AD1_GetMeasurementCompleteStatus(AD1_DeviceData));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Wait for conversion completeness&lt;/P&gt;&lt;P&gt;AD1_GetMeasuredValues(AD1_DeviceData, acqValueGroup1);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is the execution stuck in the while loop (conversion never ends). What I am missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;gaston&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:16:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394325#M3074</guid>
      <dc:creator>gschelotto</dc:creator>
      <dc:date>2020-11-02T13:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394326#M3075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello gaston,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please step over to the function "AD1_GetMeasurementCompleteStatus(AD1_DeviceData)" to check stop on which code ?&lt;/P&gt;&lt;P&gt;And i recommend you refer to the&lt;EM&gt;Typical Usage of &lt;/EM&gt; help on component to configure your code :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/54377iD7A6CE4FFD83187A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 05:11:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394326#M3075</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-07-30T05:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394327#M3076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gaston,&lt;/P&gt;&lt;P&gt;It seems that your problem is in the source code of Timers' interrupt service routines. I suppose that you are using the ADC component with interrupt enabled. The ADC driver uses also interrupt service routines. When you wait in a timer interrupt service routine for finishing the ADC conversions the ADC driver is blocked (interrupt service routine is not invoked) in your application.&lt;/P&gt;&lt;P&gt;I would recommend to start the ADC conversion (&lt;EM&gt;AD1_StartSingleMeasurement()&lt;/EM&gt; function call) in the timer ISRs only and then you can use the ADC event &lt;EM&gt;OnMeasurementComplete&lt;/EM&gt; to finishing subsequent actions (&lt;EM&gt;AD1_GetMeasuredValues()&lt;/EM&gt; and so on).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Marek Neuzil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 08:38:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394327#M3076</guid>
      <dc:creator>marek_neuzil</dc:creator>
      <dc:date>2015-07-30T08:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394328#M3077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marek/Alice,&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;I suppose that you are using the ADC component with interrupt enabled&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The ADC interrupt is disabled in PE. I've digged into ADC component help and I've found some hints from the typical usage without interrupt service&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Untitled.png"&gt;&lt;IMG alt="Untitled.png" src="https://community.nxp.com/t5/image/serverpage/image-id/54513i2D51424424EBE436/image-size/large?v=v2&amp;amp;px=999" title="Untitled.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Then I rewrite my code as shown (for the 4-sample group 1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Init code&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14382501605368505" data-renderedposition="577_8_1232_80" jivemacro_uid="_14382501605368505" modifiedtitle="true"&gt;&lt;P&gt;// Create 4-sample group &lt;/P&gt;&lt;P&gt;acqSampleGroup1[0].ChannelIdx = 1U; &lt;/P&gt;&lt;P&gt;acqSampleGroup1[1].ChannelIdx = 2U; &lt;/P&gt;&lt;P&gt;acqSampleGroup1[2].ChannelIdx = 3U; &lt;/P&gt;&lt;P&gt;acqSampleGroup1[3].ChannelIdx = 4U; &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while loop&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14382502851004192 jive_text_macro" data-renderedposition="699_8_1232_80" jivemacro_uid="_14382502851004192" modifiedtitle="true"&gt;&lt;P&gt;Error = AD1_CreateSampleGroup(AD1_DeviceDataPtr, (LDD_ADC_TSample *)acqSampleGroup1, AD1_STATIC_GROUP_1_SAMPLE_COUNT);&amp;nbsp; // Set created sample group &lt;/P&gt;&lt;P&gt;Error = AD1_SelectSampleGroup(AD1_DeviceDataPtr, 1U); &lt;/P&gt;&lt;P&gt;Error = AD1_StartSingleMeasurement(AD1_DeviceDataPtr); &lt;/P&gt;&lt;P&gt;while (!AD1_GetMeasurementCompleteStatus(AD1_DeviceDataPtr));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Wait for conversion completeness &lt;/P&gt;&lt;P&gt;Error = AD1_GetMeasuredValues(AD1_DeviceDataPtr, acqValueGroup1); &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;However the problem persist and the execution stucks in AD1_GetMeasurementCompleteStatus(AD1_DeviceDataPtr). How can I go further?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Untitled2.png"&gt;&lt;IMG alt="Untitled2.png" src="https://community.nxp.com/t5/image/serverpage/image-id/54570i1423E4E9C62E4B06/image-size/large?v=v2&amp;amp;px=999" title="Untitled2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;gaston&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:16:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394328#M3077</guid>
      <dc:creator>gschelotto</dc:creator>
      <dc:date>2020-11-02T13:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394329#M3078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gaston:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In polling mode (no interrupts) try changing your code like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14382662422636699 jive_text_macro" data-renderedposition="94.39999389648438_8_1129_126" jivemacro_uid="_14382662422636699"&gt;&lt;OL class="dp-cpp" start="1"&gt;&lt;LI&gt;Error = AD1_CreateSampleGroup(AD1_DeviceDataPtr, (LDD_ADC_TSample *)acqSampleGroup1, AD1_STATIC_GROUP_1_SAMPLE_COUNT);&amp;nbsp; &lt;SPAN class="comment"&gt;// Set created sample group&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Error = AD1_SelectSampleGroup(AD1_DeviceDataPtr, 1U); &lt;/LI&gt;&lt;LI&gt;Error = AD1_StartSingleMeasurement(AD1_DeviceDataPtr);&lt;/LI&gt;&lt;LI&gt;while((ADC_PDD_GetConversionCompleteFlag(ADC_BASE_PTR, NULL)) == FALSE);&lt;/LI&gt;&lt;LI&gt;AD1_Main(AD1_DeviceDataPtr); &lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;while (!AD1_GetMeasurementCompleteStatus(AD1_DeviceDataPtr));&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment"&gt;// Wait for conversion completeness &lt;/SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Error = AD1_GetMeasuredValues(AD1_DeviceDataPtr, acqValueGroup1);&lt;/LI&gt;&lt;/OL&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if that works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 14:24:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394329#M3078</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-07-30T14:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394330#M3079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jorge, it works as expected. Now I get the a correct measurement value for the 4-channel (group 1).&lt;/P&gt;&lt;P&gt;However when I try to get 1-channel (group 0) in Timer1 isr the execution halts this way:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Untitled.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/54278iE93088F19A2F7312/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I stepped into AD1_CreateSampleGroup function until the halt occurs and get this information:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Untitled2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/54298i4CCC592BBE8DEBED/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled2.png" alt="Untitled2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;gaston&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 09:28:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394330#M3079</guid>
      <dc:creator>gschelotto</dc:creator>
      <dc:date>2015-07-31T09:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394331#M3080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more thing. I've moved 1-channel (group 0) methods from TU1 ISR to the main loop and it works fine (code execution does not halt). Why it does not work when ADC methods are placed in TU1 ISR (every 312us)? I've measured the acquisition time and it takes less than 80us.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;gaston&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 15:32:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394331#M3080</guid>
      <dc:creator>gschelotto</dc:creator>
      <dc:date>2015-07-31T15:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394332#M3081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any feedback please? I need to perform the 1-channel (group 0) acquisition in Timer1 ISR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Aug 2015 10:21:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394332#M3081</guid>
      <dc:creator>gschelotto</dc:creator>
      <dc:date>2015-08-10T10:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394333#M3082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gaston,&lt;/P&gt;&lt;P&gt;Could you provide your application for the analysis, please? There can be several reasons of the issue (stack overflow, defect in a driver and so on).&lt;/P&gt;&lt;P&gt;The ADC_LDD driver contains a bug - when the event &lt;EM&gt;OnMeasurementComplete&lt;/EM&gt; is enabled, interrupts are disabled, the driver code of the ADC_LDD enables interrupts in ADC device registers. It cause the invocation of the &lt;EM&gt;CPU_Interrupt() &lt;/EM&gt;routine. Please, disable&lt;EM&gt; &lt;EM&gt;OnMeasurementComplete event &lt;/EM&gt;&lt;/EM&gt;in the ADC_LDD component when you use the driver in polling mode (interrupts are disabled)&lt;EM&gt;&lt;EM&gt;.&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Marek Neuzil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Aug 2015 13:08:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394333#M3082</guid>
      <dc:creator>marek_neuzil</dc:creator>
      <dc:date>2015-08-10T13:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394334#M3083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the delay in replying. I attach the application for the analysis. Relevant code is in Events.c (line 148) and app.c (line 75). I've disabled the &lt;EM&gt;&lt;EM&gt;OnMeasurementComplete event &lt;/EM&gt;&lt;/EM&gt;in the ADC_LDD component but it does not solve the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;gaston&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Sep 2015 07:40:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394334#M3083</guid>
      <dc:creator>gschelotto</dc:creator>
      <dc:date>2015-09-01T07:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394335#M3084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gaston,&lt;/P&gt;&lt;P&gt;I have analyzed you application and I have found out following issues:&lt;/P&gt;&lt;P&gt;- The hard fault exception (CPU_Interrupt subroutine) is caused by unitialized pointer in your application. You are using AD1_DeviceDataPtr pointer that is initialized in the appInit() function but the TU1 component is intialized in the PE_low_level_init (timer is enabled). The TU1_OnCounterRestart is invoked before the &lt;EM&gt;AD1_DeviceDataPtr&lt;/EM&gt; is initialized (null pointer exception). Therefore you must disable the timer in the initialization (set the &lt;EM&gt;Enabled in Init. Code&lt;/EM&gt; property to &lt;EM&gt;no&lt;/EM&gt;) and call TU1_Enable() method after the AD1_DeviceDataPtr pointer is initialized in the acqInit() function.&lt;/P&gt;&lt;P&gt;- The AD1 component (driver) initialization is executed twice in your application. There is enabled autoinitialization in the AD1 component (the &lt;EM&gt;Autoinitialization&lt;/EM&gt; property is set to &lt;EM&gt;yes; &lt;/EM&gt;the AD1_Init() is called in the &lt;EM&gt;PE_low_level_init()&lt;/EM&gt;) and you also call &lt;EM&gt;AD1_Init()&lt;/EM&gt; function in the acqInit() function. If you want to use the &lt;EM&gt;AD1_DeviceDataPtr &lt;/EM&gt;you can just do assignment &lt;EM&gt;AD1_DeviceDataPtr =&amp;nbsp; &lt;EM&gt;AD1_DeviceData; (&lt;EM&gt;AD1_DeviceData&lt;/EM&gt; &lt;/EM&gt;&lt;/EM&gt;is macro defined in the &lt;EM&gt;AD1.h&lt;/EM&gt; and it provides initialized pointer to device data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See for example you code in the Event.c:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void TU1_OnCounterRestart(LDD_TUserData *UserDataPtr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Write your code here ... */&lt;/P&gt;&lt;P&gt;word i;&lt;/P&gt;&lt;P&gt;LDD_TError Error;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . . .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error = AD1_SelectSampleGroup(&lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt;AD1_DeviceDataPtr&lt;/STRONG&gt;&lt;/SPAN&gt;, 0U);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error = AD1_StartSingleMeasurement(&lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt;AD1_DeviceDataPtr&lt;/STRONG&gt;&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ((ADC_PDD_GetConversionCompleteFlag(ADC_BASE_PTR, NULL)) == FALSE);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AD1_Main(AD1_DeviceDataPtr);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (!AD1_GetMeasurementCompleteStatus(&lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt;AD1_DeviceDataPtr&lt;/STRONG&gt;&lt;/SPAN&gt;));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Wait for conversion completeness&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AD1_GetMeasuredValues(&lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt;AD1_DeviceData&lt;/STRONG&gt;&lt;/SPAN&gt;, acqValueGroup0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; acqValueGroup0[0] -= 2047;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; . . .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I.e. you use &lt;EM&gt;AD1_DeviceDataPtr pointer &lt;/EM&gt;and&lt;EM&gt; &lt;EM&gt;AD1_DeviceData &lt;/EM&gt;&lt;/EM&gt;macro in one function (the same pointers).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have fixed your application, see the attached archive. I have also checked the you can measure any sample group in the &lt;EM&gt;TU1_OnCounterRestart()&lt;/EM&gt; event&lt;EM&gt;, i.e. you can call&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Error = AD1_SelectSampleGroup(&lt;SPAN style="color: #303030;"&gt;AD1_DeviceDataPtr&lt;/SPAN&gt;, 0U);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;or &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;EM&gt;Error = AD1_SelectSampleGroup(&lt;SPAN style="color: #303030;"&gt;AD1_DeviceDataPtr&lt;/SPAN&gt;, 1U);&lt;/EM&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Both sample groups can be measured in this event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see also another synchronization issue in your application. There are measurement executed in an interrupt (&lt;EM&gt;TU1_OnCounterRestart()&lt;/EM&gt; event) and in the main process &lt;EM&gt;- acqProcess()&lt;/EM&gt; function&lt;EM&gt;. &lt;/EM&gt;I am not sure but it seems to me that these measurement are not synchronized. i.e. you must ensure that &lt;EM&gt;acqProcess() &lt;/EM&gt;function&lt;EM&gt; (&lt;/EM&gt;measurement of the AD1 channels) is not interrupt by TU1 interrupt (&lt;EM&gt;TU1_OnCounterRestart() &lt;/EM&gt;event call&lt;EM&gt;). &lt;/EM&gt;Otherwise AD1 results can corrupted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Marek Neuzil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2015 08:08:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394335#M3084</guid>
      <dc:creator>marek_neuzil</dc:creator>
      <dc:date>2015-09-03T08:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: ADC conversion does not complete</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394336#M3085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marek, I'm very grateful for your help. You have not only fixed the issue but you've also found potential bugs in my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;gaston&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2015 11:43:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/ADC-conversion-does-not-complete/m-p/394336#M3085</guid>
      <dc:creator>gschelotto</dc:creator>
      <dc:date>2015-09-04T11:43:38Z</dc:date>
    </item>
  </channel>
</rss>

