<?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: One LPTMR as Trigger for two ADC_PAL in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022477#M5995</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mario,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is caused by this line in the application code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;status_t adcStartConversionCurrentAndVoltage(void)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[...]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;state = ADC_EnableHardwareTrigger(&amp;amp;adc0_instance, ADC_GROUPINDEX_00);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; state = state &amp;amp;&amp;amp; ADC_EnableHardwareTrigger(&amp;amp;adc1_instance, ADC_GROUPINDEX_00);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The compiler optimizes out the second call to&amp;nbsp;&lt;SPAN&gt;ADC_EnableHardwareTrigger(&amp;amp;adc1_instance, ADC_GROUPINDEX_00);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This most likely happens because&amp;nbsp;the first call returns state == STATUS_SUCCESS, which is in fact 0x0000 =&amp;gt; &amp;amp;&amp;amp; operation with 0 will always be false, so no need to call&amp;nbsp;&lt;SPAN&gt;ADC_EnableHardwareTrigger(&amp;amp;adc1_instance, ADC_GROUPINDEX_00);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the line to something like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;state0 = ADC_EnableHardwareTrigger(&amp;amp;adc0_instance, ADC_GROUPINDEX_00);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;state1 = ADC_EnableHardwareTrigger(&amp;amp;adc1_instance, ADC_GROUPINDEX_00);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if( state0 == STATUS_SUCCESS &amp;amp;&amp;amp; state1 == STATUS_SUCCESS)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;and the scenario will work fine.&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;Best regards,&lt;/P&gt;&lt;P&gt;Cosmin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jan 2020 17:56:07 GMT</pubDate>
    <dc:creator>cosmindinu</dc:creator>
    <dc:date>2020-01-23T17:56:07Z</dc:date>
    <item>
      <title>One LPTMR as Trigger for two ADC_PAL</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022472#M5990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi together&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a project I want to use the ADC_PAL component for group conversion.&lt;/P&gt;&lt;P&gt;For this I have have two ADC_PAL components with each a group with different adc channels.&lt;/P&gt;&lt;P&gt;Now I want to have these two groups triggered by a LPTMR component continuously. Both adc have the same settings, but adc1 is not running.&lt;/P&gt;&lt;P&gt;Is it not possible to use one LPTMR instance to trigger two ADC_PAL instances?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/96346i03A3FAF2C3206FF8/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you can see the start of the continuous conversion.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/96398iDF36C64E0AD879FF/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/96447i630ECAED4531FD92/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2020 11:16:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022472#M5990</guid>
      <dc:creator>EE_CW</dc:creator>
      <dc:date>2020-01-16T11:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: One LPTMR as Trigger for two ADC_PAL</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022473#M5991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mario,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, accept my apologies for the delay. I do some tests with the adc_pal_s32k144 example. I have added the second pal component and I have used the same configuration for ADC1 such as for ADC0, with device triggering unit PDB1 and with unchecked &lt;EM&gt;Extension Supply Monitoring Enable&amp;nbsp;&lt;/EM&gt;which&amp;nbsp;is only available on ADC0.&lt;/P&gt;&lt;P&gt;If it is enabled for ADC1, then a DEV_ASSERT in ADC_Init() will be triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/98722i244D38D7FFA9356C/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is it your issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Diana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2020 14:10:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022473#M5991</guid>
      <dc:creator>dianabatrlova</dc:creator>
      <dc:date>2020-01-22T14:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: One LPTMR as Trigger for two ADC_PAL</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022474#M5992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Diana&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;For my project I use a LPTMR instance which should trigger both ADC at the same time.&lt;/P&gt;&lt;P&gt;With unchecked "Extension Supply Monitoring Enable" it still does not work.&lt;BR /&gt;Did you used a PDB Component for triggering the ADCs?&lt;/P&gt;&lt;P&gt;Because if I try to use a PDB instead of a LPTMR as trigger there is an error in the ADC_PAL instance that the PDB instance is already used by the PDB component:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/98765i254E05A5C45369B1/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your feedback&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2020 11:58:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022474#M5992</guid>
      <dc:creator>EE_CW</dc:creator>
      <dc:date>2020-01-23T11:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: One LPTMR as Trigger for two ADC_PAL</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022475#M5993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="padding: 0px;"&gt;Hi Mario, Diana,&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;Sorry for the late response&lt;/P&gt;&lt;P style="padding: 0px;"&gt;ADC_PAL supports the scenario for using LPTMR to trigger conversions in parallel on both instances of ADC. Just make sure to uncheck&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;EM&gt;Extension Supply Monitoring Enable&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d;"&gt;for the adc_pal configured over ADC1, to avoid the DEV_ASSERT, as already mentioned by Diana.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;Each ADC_PAL instance already uses 1 ADC instance and 1 PDB, so it is not possible/required to add them in&amp;nbsp;the project when using also ADC_PAL. The ADC_PAL uses also TRGMUX to route LPTMR signal to the PDB and ADC.&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;Are you configuring ADC_PAL1 on ADC0 &amp;amp; PDB0 and ADC_PAL2 on ADC1 &amp;amp; PDB1? Also make sure you are calling&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ADC_Init and&amp;nbsp;ADC_EnableHardwareTrigger, for each instance and group.&lt;/P&gt;&lt;P style="padding: 0px;"&gt;Could you please provide more info on the behavior which you are encountering? Or if possible attach the project?&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;Cosmin&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2020 13:41:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022475#M5993</guid>
      <dc:creator>cosmindinu</dc:creator>
      <dc:date>2020-01-23T13:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: One LPTMR as Trigger for two ADC_PAL</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022476#M5994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Cosmin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;Yes, originally I configured ADC_PAL0 on ADC0 &amp;amp; PDB0 and ADC_PAL1 on ADC1 &amp;amp; PDB1.&lt;/P&gt;&lt;P&gt;I attached my sample project.&lt;/P&gt;&lt;P&gt;There I wait until a conversion of ADC0 or ADC1 is done.&lt;/P&gt;&lt;P&gt;I'm calling the ADC_init and ADC_EnableHardwareTrigger of both instances.&lt;/P&gt;&lt;P&gt;But it seems that the ADC1 doesn't work, because I never get the convDone-Flag.&lt;/P&gt;&lt;P&gt;The Callback-function of ADC1 also never gets called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried also SW-Triggering. There I changed both ADC_PAL instances to SW Triggering. Then I called the ADC_StartGroupConversion() of both ADCs during LPTMR_ISR. But even then it didn't work. Only one ADC seemed to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you can follow my descritions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2020 15:58:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022476#M5994</guid>
      <dc:creator>EE_CW</dc:creator>
      <dc:date>2020-01-23T15:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: One LPTMR as Trigger for two ADC_PAL</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022477#M5995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mario,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is caused by this line in the application code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;status_t adcStartConversionCurrentAndVoltage(void)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[...]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;state = ADC_EnableHardwareTrigger(&amp;amp;adc0_instance, ADC_GROUPINDEX_00);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; state = state &amp;amp;&amp;amp; ADC_EnableHardwareTrigger(&amp;amp;adc1_instance, ADC_GROUPINDEX_00);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The compiler optimizes out the second call to&amp;nbsp;&lt;SPAN&gt;ADC_EnableHardwareTrigger(&amp;amp;adc1_instance, ADC_GROUPINDEX_00);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This most likely happens because&amp;nbsp;the first call returns state == STATUS_SUCCESS, which is in fact 0x0000 =&amp;gt; &amp;amp;&amp;amp; operation with 0 will always be false, so no need to call&amp;nbsp;&lt;SPAN&gt;ADC_EnableHardwareTrigger(&amp;amp;adc1_instance, ADC_GROUPINDEX_00);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the line to something like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;state0 = ADC_EnableHardwareTrigger(&amp;amp;adc0_instance, ADC_GROUPINDEX_00);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;state1 = ADC_EnableHardwareTrigger(&amp;amp;adc1_instance, ADC_GROUPINDEX_00);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if( state0 == STATUS_SUCCESS &amp;amp;&amp;amp; state1 == STATUS_SUCCESS)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;and the scenario will work fine.&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;Best regards,&lt;/P&gt;&lt;P&gt;Cosmin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2020 17:56:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022477#M5995</guid>
      <dc:creator>cosmindinu</dc:creator>
      <dc:date>2020-01-23T17:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: One LPTMR as Trigger for two ADC_PAL</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022478#M5996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cosmin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;With your suggestion it works. Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2020 13:59:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/One-LPTMR-as-Trigger-for-two-ADC-PAL/m-p/1022478#M5996</guid>
      <dc:creator>EE_CW</dc:creator>
      <dc:date>2020-01-24T13:59:53Z</dc:date>
    </item>
  </channel>
</rss>

