<?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>Model-Based Design Toolbox (MBDT)のトピックADC trigger by FTM directly on KV5x MBDT</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1367551#M6663</link>
    <description>&lt;P&gt;Hi, nxp service,&lt;BR /&gt;I would like to ask you a question about ADC and FTM. I want to trigger ADC by FTM0 directly.&lt;BR /&gt;I configure the software with MCUxpresso Configuration Tool. But, when I generate the code, I debug this code, I see that ADC ISR doesn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached the simulink and the configuration file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me to know issues.&lt;/P&gt;</description>
    <pubDate>Sun, 07 Nov 2021 13:48:36 GMT</pubDate>
    <dc:creator>CauTran</dc:creator>
    <dc:date>2021-11-07T13:48:36Z</dc:date>
    <item>
      <title>ADC trigger by FTM directly on KV5x MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1367551#M6663</link>
      <description>&lt;P&gt;Hi, nxp service,&lt;BR /&gt;I would like to ask you a question about ADC and FTM. I want to trigger ADC by FTM0 directly.&lt;BR /&gt;I configure the software with MCUxpresso Configuration Tool. But, when I generate the code, I debug this code, I see that ADC ISR doesn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached the simulink and the configuration file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me to know issues.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Nov 2021 13:48:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1367551#M6663</guid>
      <dc:creator>CauTran</dc:creator>
      <dc:date>2021-11-07T13:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: ADC trigger by FTM directly on KV5x MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1368781#M6670</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/190527"&gt;@CauTran&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've looked into your .mex file and I've noticed multiple missing settings that explains the problem with the generating code.&lt;/P&gt;
&lt;P&gt;First, the Hardware Interrupt blocks is telling that there is no interrupt enabled in the .mex file for the ADC peripheral. It also telling that the user should use the Configure button to open the .mex file in MCUXpresso Configuration Tool and enable the ADC interrupts.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_1-1636486992442.png" style="width: 511px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161709i5E1EB45B757E1D9E/image-dimensions/511x207?v=v2" width="511" height="207" role="button" title="nxa11767_1-1636486992442.png" alt="nxa11767_1-1636486992442.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you check the &lt;STRONG&gt;Interrupt request&amp;nbsp;&lt;/STRONG&gt;in Configuration Tool (ctrl+S to save the change) and then Update in the Interrupt Handler block you'll see the name of the ADC interrupt handler:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_2-1636487154777.png" style="width: 442px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161710i114699096873560A/image-dimensions/442x202?v=v2" width="442" height="202" role="button" title="nxa11767_2-1636487154777.png" alt="nxa11767_2-1636487154777.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Same applies for the Start/Stop Hardware Interrupt block:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_3-1636487209882.png" style="width: 456px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161711i0EDAB9F66187DEC7/image-dimensions/456x235?v=v2" width="456" height="235" role="button" title="nxa11767_3-1636487209882.png" alt="nxa11767_3-1636487209882.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Because in the .mex file, Interrupt request is set to Not initialized:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_4-1636487298998.png" style="width: 416px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161712iB84FD371C5482255/image-dimensions/416x52?v=v2" width="416" height="52" role="button" title="nxa11767_4-1636487298998.png" alt="nxa11767_4-1636487298998.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then you need to add the Start/Stop Hardware Interrupt block to insert the code that enables the ADC0_IRQn interrupt. (EnableIRQ call). The alternative of this block is to choose the Enabled in Initialization, that will insert the peripherals.c, in ADC0_init the EnableIRQ call and so you'll not need to use the ISR start stop block.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_5-1636487471732.png" style="width: 410px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161713i339454C2BE00FA6E/image-dimensions/410x169?v=v2" width="410" height="169" role="button" title="nxa11767_5-1636487471732.png" alt="nxa11767_5-1636487471732.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You've noticed that the Configuration Tool is showing an warning on Interrupt Request - the warning is saying:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_6-1636487612253.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161714iD266B8EC6669BA80/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_6-1636487612253.png" alt="nxa11767_6-1636487612253.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The next step, is to configure and ADC channel in the .mex file:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_7-1636487727086.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161715i92BBBF8775040245/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_7-1636487727086.png" alt="nxa11767_7-1636487727086.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Use the + button to add an ADC channel, select the channel number on which the conversion will happen, enable the interrupt on the channel and also initialize the channel. For channel number, the selection, the tool provides a drop-down with the pins that were set in the pins view for the ADC0 peripheral:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_8-1636488068270.png" style="width: 428px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161716i7F868FB2F0CEBC7B/image-dimensions/428x295?v=v2" width="428" height="295" role="button" title="nxa11767_8-1636488068270.png" alt="nxa11767_8-1636488068270.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I recommend to take a look at the ADC examples in the toolbox - we have examples on configuring and using the ADC on polling mode - &lt;STRONG&gt;twrkv58f_adc_polling.mdl&lt;/STRONG&gt;-, so no interrupts are being configured, and also on interrupts - &lt;STRONG&gt;twrkv58f_adc_interrupt.mdl&lt;/STRONG&gt;-, that's the use case described above.&lt;/P&gt;
&lt;P&gt;As for the FTM configuration, if no channels are being set then the FTM will act as a simple timer. To use it for input capture/dual edge capture, pwm generation you must add and configure the FTM channels:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_9-1636488688200.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161720iB2113972903827A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_9-1636488688200.png" alt="nxa11767_9-1636488688200.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In order to use the FTM update duty cycle block, you must configure at least one FTM channel for PWM generation. Also for FTM you can take a look at the examples from the toolbox.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;In our ADC examples, the conversion is triggered by software. For hardware trigger, the Use Hardware Trigger must be enabled in the .mex file:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_10-1636488991276.png" style="width: 411px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161721i189AF1729614DC8E/image-dimensions/411x115?v=v2" width="411" height="115" role="button" title="nxa11767_10-1636488991276.png" alt="nxa11767_10-1636488991276.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And you must configure at lease one of the trigger pins in the Pins view:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_11-1636489156861.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161722iED2AD07DFBAA8120/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_11-1636489156861.png" alt="nxa11767_11-1636489156861.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I've looked into the manual for KV5x and it mentions that the ADC can be triggered by the PDB:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_12-1636489249515.png" style="width: 420px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161723i717C0FF91F23FD76/image-dimensions/420x85?v=v2" width="420" height="85" role="button" title="nxa11767_12-1636489249515.png" alt="nxa11767_12-1636489249515.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And the FTM can trigger the PDB:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_13-1636489341714.png" style="width: 421px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/161724i741F6961E1260653/image-dimensions/421x285?v=v2" width="421" height="285" role="button" title="nxa11767_13-1636489341714.png" alt="nxa11767_13-1636489341714.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can you please give more details on the application that you want to build? with more information I can try to create a .mex file that will map your application needs.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Alexandra&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 20:26:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1368781#M6670</guid>
      <dc:creator>nxa11767</dc:creator>
      <dc:date>2021-11-09T20:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: ADC trigger by FTM directly on KV5x MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1370355#M6680</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/123994"&gt;@nxa11767&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;When I want to configure 2 channels ADC to sample and converter. But when I configure like that, ADC module can not interrupt like one channel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 04:50:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1370355#M6680</guid>
      <dc:creator>CauTran</dc:creator>
      <dc:date>2021-11-12T04:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: ADC trigger by FTM directly on KV5x MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1383838#M6780</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/123994"&gt;@nxa11767&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I would like to have a question about ADC. Is there any problems if I use more than one channel in ADC16 channels configuration check box?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I do it, How about the process for ADC convert and get the ADC data?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 07:33:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1383838#M6780</guid>
      <dc:creator>CauTran</dc:creator>
      <dc:date>2021-12-09T07:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: ADC trigger by FTM directly on KV5x MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1385166#M6791</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/190527"&gt;@CauTran&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can configure two ADC channel, but you need to assign them to separate groups:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_0-1639241692742.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/164843iC303D5C62E847E1A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_0-1639241692742.png" alt="nxa11767_0-1639241692742.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; In the interrupt handler, you can check the channel group register to see if conversion is done and read the converted value:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nxa11767_0-1639246727096.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/164845i937DE3E3ACA56724/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nxa11767_0-1639246727096.png" alt="nxa11767_0-1639246727096.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But you must configure the ADC channel assigned to group1 to be triggered by hardware event - software trigger is supported only on group 0 (you can see the information also in MCUX configuration tool as a tooltip in group selection for the channel but also in the processor reference manual).&lt;/P&gt;
&lt;P&gt;You can try also to use the same conversion group for both channels with continuous conversion unchecked in the MCUX Configuration Tool file, and software trigger the conversion from Simulink alternatively on each channel (or at a user button press) by using the ADC Start Block. And in the ADC interrupt handler you add just one ADC Read block - will not matter what selection of the channel you do there, since the read on done on the conversion group and not on the channel (we need to rethink that block for the next release).&lt;/P&gt;
&lt;P&gt;I hope this info helps!&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Alexandra&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR,&lt;BR /&gt;Alexandra&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:27:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1385166#M6791</guid>
      <dc:creator>nxa11767</dc:creator>
      <dc:date>2021-12-11T18:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: ADC trigger by FTM directly on KV5x MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1385224#M6792</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/123994"&gt;@nxa11767&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Can you send me that demo file to deeply understand this issue?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 01:46:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1385224#M6792</guid>
      <dc:creator>CauTran</dc:creator>
      <dc:date>2021-12-13T01:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: ADC trigger by FTM directly on KV5x MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1385457#M6794</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/190527"&gt;@CauTran&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I've attached two models and their .mex files - one with two channels on same group and one with two channels on separate groups. For the latter, you need to configure for e.g PDB-ul to trigger the ADC conversion on group 1 (since group 1 can't be software triggered).&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Alexandra&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 08:06:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1385457#M6794</guid>
      <dc:creator>nxa11767</dc:creator>
      <dc:date>2021-12-13T08:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: ADC trigger by FTM directly on KV5x MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1385524#M6795</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/123994"&gt;@nxa11767&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I saw your example files, but I have a question for you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My application is motor control and therefore, I need to measure phase currents and DC voltage. The measurement is a sequence and&amp;nbsp; triggered by FTM or PDB module.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, for your demo file, I have some confuses because, when I use both hardware trigger and software trigger ( ADC start block), the ADC interrupt will be not happen.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you tell me how to configure ADC module based on my idea?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 09:17:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-trigger-by-FTM-directly-on-KV5x-MBDT/m-p/1385524#M6795</guid>
      <dc:creator>CauTran</dc:creator>
      <dc:date>2021-12-13T09:17:31Z</dc:date>
    </item>
  </channel>
</rss>

