<?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 RT117x: Multichannel ADC read in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/RT117x-Multichannel-ADC-read/m-p/2051042#M10030</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using NXP Model-Based Design Toolbox for iMXRT117x and have multiple channels to read from. However, using multiple ADC Read blocks results in compile error as multiple lines of the following code are placed in code:&lt;/P&gt;&lt;P&gt;lpadc_conv_result_t mLpadcResultConfigStruct[%&amp;lt;adcParams.commandsNumber&amp;gt;];&lt;BR /&gt;const uint32_t g_LpadcResultShift = %&amp;lt;resultShift&amp;gt;;&lt;/P&gt;&lt;P&gt;The Help dialog box and example only demonstrate a single ADC read and that the output is the converted value. How can I do this for multiple ADC channels to read from?&lt;/P&gt;&lt;P&gt;I am using version 1.3.0 of the toolbox.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2025 18:13:46 GMT</pubDate>
    <dc:creator>SecularC</dc:creator>
    <dc:date>2025-02-25T18:13:46Z</dc:date>
    <item>
      <title>RT117x: Multichannel ADC read</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/RT117x-Multichannel-ADC-read/m-p/2051042#M10030</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using NXP Model-Based Design Toolbox for iMXRT117x and have multiple channels to read from. However, using multiple ADC Read blocks results in compile error as multiple lines of the following code are placed in code:&lt;/P&gt;&lt;P&gt;lpadc_conv_result_t mLpadcResultConfigStruct[%&amp;lt;adcParams.commandsNumber&amp;gt;];&lt;BR /&gt;const uint32_t g_LpadcResultShift = %&amp;lt;resultShift&amp;gt;;&lt;/P&gt;&lt;P&gt;The Help dialog box and example only demonstrate a single ADC read and that the output is the converted value. How can I do this for multiple ADC channels to read from?&lt;/P&gt;&lt;P&gt;I am using version 1.3.0 of the toolbox.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 18:13:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/RT117x-Multichannel-ADC-read/m-p/2051042#M10030</guid>
      <dc:creator>SecularC</dc:creator>
      <dc:date>2025-02-25T18:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: RT117x: Multichannel ADC read</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/RT117x-Multichannel-ADC-read/m-p/2055739#M10070</link>
      <description>Bumping</description>
      <pubDate>Tue, 04 Mar 2025 20:00:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/RT117x-Multichannel-ADC-read/m-p/2055739#M10070</guid>
      <dc:creator>SecularC</dc:creator>
      <dc:date>2025-03-04T20:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: RT117x: Multichannel ADC read</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/RT117x-Multichannel-ADC-read/m-p/2065690#M10146</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I've attached an example that reads from 3 channels as below:&lt;/P&gt;
&lt;P&gt;- &lt;STRONG&gt;XBAR0_TRIG.0&lt;/STRONG&gt;: Read voltage (COMMAND ID 1) on J9[10]&lt;/P&gt;
&lt;P&gt;-&lt;STRONG&gt;XBAR0_TRIG.1&lt;/STRONG&gt;: Read voltage (COMMAND ID 2 and 3) on J26[12] and J26[2],&amp;nbsp;respectively.&lt;/P&gt;
&lt;P&gt;In this example, the trigger to read ADC values is done via Software (&lt;STRONG&gt;ADC_ETC_START&lt;/STRONG&gt; blocks), which is ran at every step execution (once 0.2s).&lt;/P&gt;
&lt;P&gt;XBAR0_TRIG.0 triggers the ADC_ETC_IRQ0_IRQHandler interrupt, which read the voltage on J9[10] (Data Memory &lt;STRONG&gt;Chan1&lt;/STRONG&gt;) and increment the variable &lt;STRONG&gt;counter_trig0&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;XBAR0_TRIG.1 triggers the ADC_ETC_IRQ1_IRQHandler interrupt, which read the voltage on J26[12] (Data Memory &lt;STRONG&gt;Chan2&lt;/STRONG&gt;) and J26[2] (Data Memory &lt;STRONG&gt;Chan3&lt;/STRONG&gt;)&amp;nbsp; and increment the variable &lt;STRONG&gt;counter_trig1&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Please use the included FreeMASTER project to check the values of all these variables. In the image below, I used a 1.21V reference voltage applied on all 3 channels, one at a time. As there are no pulldown/pullup resistors, if no voltage is applied, the read values is floating around random values.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SorinIBancila_0-1742485923450.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/329117iA527C867DB29950E/image-size/large?v=v2&amp;amp;px=999" role="button" title="SorinIBancila_0-1742485923450.png" alt="SorinIBancila_0-1742485923450.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Sorin Bancila&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 15:55:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/RT117x-Multichannel-ADC-read/m-p/2065690#M10146</guid>
      <dc:creator>SorinIBancila</dc:creator>
      <dc:date>2025-03-20T15:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: RT117x: Multichannel ADC read</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/RT117x-Multichannel-ADC-read/m-p/2065730#M10148</link>
      <description>&lt;P&gt;Thanks for your example. Is it possible to perform a multi-channel read using just the LPADC blocks, or is it necessary to use the ADC_ETC? I do not need any external hardware triggers but will need a software trigger.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 17:16:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/RT117x-Multichannel-ADC-read/m-p/2065730#M10148</guid>
      <dc:creator>SecularC</dc:creator>
      <dc:date>2025-03-20T17:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: RT117x: Multichannel ADC read</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/RT117x-Multichannel-ADC-read/m-p/2065838#M10151</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Unfortunately, it is not possible to use multiple LPADC blocks. Only way to read multiple channel is to use the ADC_ETC.&lt;/P&gt;
&lt;P&gt;The example that I attached in the previous reply includes a multi-channel read, using software triggers (&lt;STRONG&gt;ADC_ETC_Start&lt;/STRONG&gt; blocks)..&lt;BR /&gt;Best regards,&lt;BR /&gt;Sorin Ioanid&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 21:05:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/RT117x-Multichannel-ADC-read/m-p/2065838#M10151</guid>
      <dc:creator>SorinIBancila</dc:creator>
      <dc:date>2025-03-20T21:05:09Z</dc:date>
    </item>
  </channel>
</rss>

