<?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)のトピックRe: ADC Conversion- Event Based for MPC5744P</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807902#M2416</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/smuley@tae.com"&gt;smuley@tae.com&lt;/A&gt;‌&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is to use the latest value of ADC and do some calculation and update the PWM (I think, this is what you want). If you want to discretize the Sine wave at 200Hz. Choose a PWM switching frequency (20000 Hz will get you 100 sample in one sine wave). From then, it remains the same. You can Synchronize PWM -&amp;gt; CTU-&amp;gt;ADC. It does not matter as on PWM side you will receive the latest ADC value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Oct 2019 07:13:44 GMT</pubDate>
    <dc:creator>abhishek_kumar1</dc:creator>
    <dc:date>2019-10-15T07:13:44Z</dc:date>
    <item>
      <title>ADC Conversion- Event Based for MPC5744P</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807898#M2412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use ADC conversion which is triggered by an event. (FlexPWM -&amp;gt;&amp;nbsp; Programmable Delay -&amp;gt; ADC)&lt;/P&gt;&lt;P&gt;So, This is what I want to achieve in&amp;nbsp;MPC5744P (Model Based Design Toolbox)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/63296iF9413D5F733D14B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see in the MDB toolbox that events are triggered for "End of Conversion" but I can not find where do I use an External trigger for start of sampling. Please see my try below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/62755i79896FC326C4F3D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Inside the triggered ADC Phase A block (below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/62756iC53A5BB60597C6A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help on this topic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 15:47:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807898#M2412</guid>
      <dc:creator>abhishek_kumar1</dc:creator>
      <dc:date>2018-11-06T15:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Conversion- Event Based for MPC5744P</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807899#M2413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/abhishek.kumar@chassisbrakes.com"&gt;abhishek.kumar@chassisbrakes.com&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for our delayed answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the MPC5744P the Programmable delay is achieved using the Cross-Triggering Unit (CTU). So for more information please read the Chapter 41 from the &lt;A class="link-titled" href="https://www.nxp.com/docs/en/reference-manual/MPC5744PRM.pdf" title="https://www.nxp.com/docs/en/reference-manual/MPC5744PRM.pdf"&gt;MPC5744PRM.pdf&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Now, to be more helpful I have attached an example that converts two ADC channels triggered by the PWM blocks on a channel's rising edge. Because I have tested the example on the MPC5744PDevKit, I used the ADC 1 module and other pin to have access to a potentiometer, but for your need the workflow is the same.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I started adding a Complementary PWM Output block to generate a 25Hz PWM signal. For some visual feedback I also added the Green LED to blink every second.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/78242i93DF1A5C7A3831D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.JPG" alt="2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, the CTU Block has the Input Selection configured to have the PWM channel 0 odd on Rising event. Here you can select which action will launch the conversions. in our case, the Triggered 0 ADC command was enabled.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="3.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/78243i38A897F35D03011A/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.JPG" alt="3.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the same mask(CTU configuration), but in the ADC Commands tab, the ADC commands number was set to 2, it your case it will be 3. Also, the channels on which the conversion will be started are set here: in our case 6 and 11. Also, in the ADC Config block the CTU checkbox was set.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="5.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/78282iA79E09B8AC2BD0DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="5.JPG" alt="5.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, the ADC interrupt was added to be triggered at the End of CTU conversion. In this handler, the converted values from the channel 6 (the one on which the potentiometer is connected on the evaluation board) and the channel 11 (randomly selected) are read into the value_A and value_B.&lt;/P&gt;&lt;P&gt;I also added a FreeMASTER connection to the board to see in real time the converted values. Here, the Red LED is toggled every time also for a visual feedback.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached to this replay you can find the model and the freeMaster files on which we tested the program explained above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Marius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2018 17:37:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807899#M2413</guid>
      <dc:creator>mariuslucianand</dc:creator>
      <dc:date>2018-11-20T17:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Conversion- Event Based for MPC5744P</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807900#M2414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Marius,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll implement it and share lessons learnt for others!&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Nov 2018 14:42:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807900#M2414</guid>
      <dc:creator>abhishek_kumar1</dc:creator>
      <dc:date>2018-11-22T14:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Conversion- Event Based for MPC5744P</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807901#M2415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marius,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to implement the exact opposite process using model based design. I want to read the ADC as fast as possible and generate PWM with variable duty cycle. For eg. the input to the ADC is a 200Hz sine wave, i am dividing the ADC output by 4096 to get the duty cycle between 0 and 1 and providing it as an input to the FlexPWM generator block. But when i check the output on the Oscilloscope the duty cycle of the output PWM signal changes extrmely slowly as compared to the change in the input sine wave. I checked the output of the ADC and that seems to be updating according to the input wave. I also tried to implement it using ADC interrupt but got the same result.&lt;/P&gt;&lt;P&gt;Please let me know if there is another way to implement it.&lt;/P&gt;&lt;P&gt;Below is my current setup.&lt;/P&gt;&lt;P&gt;1)&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/91635i52C5A7C13EBCCC61/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/91679iCB3F62721E0EA9AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside the ADC ISR Handler:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/91718i68D6249479074483/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Saurabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2019 03:56:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807901#M2415</guid>
      <dc:creator>smuley</dc:creator>
      <dc:date>2019-10-15T03:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Conversion- Event Based for MPC5744P</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807902#M2416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/smuley@tae.com"&gt;smuley@tae.com&lt;/A&gt;‌&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is to use the latest value of ADC and do some calculation and update the PWM (I think, this is what you want). If you want to discretize the Sine wave at 200Hz. Choose a PWM switching frequency (20000 Hz will get you 100 sample in one sine wave). From then, it remains the same. You can Synchronize PWM -&amp;gt; CTU-&amp;gt;ADC. It does not matter as on PWM side you will receive the latest ADC value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2019 07:13:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807902#M2416</guid>
      <dc:creator>abhishek_kumar1</dc:creator>
      <dc:date>2019-10-15T07:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Conversion- Event Based for MPC5744P</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807903#M2417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/smuley@tae.com"&gt;smuley@tae.com&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the screenshot you have attached, it seems like you started from our adc_isr_mpc574xP example model and is easier for me to have a discussion based on that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the model works like this: the ADC&amp;nbsp;Start block is called on the step, which is set at 0.1 seconds.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/92033i16D23ECD0D52AD4F/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After the conversion is complete the ADC ISR block is called. So for the beginning, the conversions are performed at each 100ms.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, you have multiple approaches to get conversion after conversion, or to get conversions at specified sample time:&lt;/P&gt;&lt;P&gt;1. You can try using the "Scan" conversion mode &lt;STRONG&gt;"a&amp;nbsp;specified sequential conversion is continuously performed"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/92080iCD851965799504F5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. If 1 is not working, you can also add the ADC Start block inside the ADC ISR S-function but be sure that it will be called after the PWM block (you can use lower block priority) and also you should have an ADC start block at the beginning of the model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. IF you need a specific sample time for the ADC conversion, you can use a PIT interrupt to call the ADC start block at the sample time you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Marius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2019 07:22:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/ADC-Conversion-Event-Based-for-MPC5744P/m-p/807903#M2417</guid>
      <dc:creator>mariuslucianand</dc:creator>
      <dc:date>2019-10-15T07:22:28Z</dc:date>
    </item>
  </channel>
</rss>

