<?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: Current-limit PWM in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Current-limit-PWM/m-p/823940#M2555</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Constantin,&lt;/P&gt;&lt;P&gt;I will repost my question in the relevant section.&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Aug 2018 12:36:40 GMT</pubDate>
    <dc:creator>engineer12</dc:creator>
    <dc:date>2018-08-24T12:36:40Z</dc:date>
    <item>
      <title>Current-limit PWM</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Current-limit-PWM/m-p/823938#M2553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have MC56F82748VLH chip and I want to generate PWM in complementary mode. The type of PWM&amp;nbsp;(Current-limit PWM)&amp;nbsp;I want to achieve is controlled&amp;nbsp;by varying the duty cycle - when the inductor current reaches a desired maximum value&amp;nbsp;the PWM truncates/turn-off the edge value VAL3. I saw this type of control in the AN4485 application note for the MC56F82xx chip and the correlated example code.&lt;/P&gt;&lt;P&gt;The problem I have is that the reference manuals of the 2 chips is very different and I don't understand how to setup the comparator. The comparator has to generate a fault/trip event which truncates the PWM signal.&lt;/P&gt;&lt;P&gt;1. The PWM fault needs to be enabled, for which I created the following code:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// Set fault disable mapping register&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; PWMA_SM1DISMAP0 = 0x0FFFU;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; PWMA_SM1DISMAP1 = 0x0FFFU; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;//Disable fault filter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;PWMA_FFILT0 = 0x00U;&lt;/P&gt;&lt;P&gt;PWMA_FFILT1 = 0x00U;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// Fault Status Register - Set only full cycle fault clearing timing&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;PWMA_FSTS0 = 0x0010U;&lt;/P&gt;&lt;P&gt;PWMA_FSTS1 = 0x0010U;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;//Set logic 1 as fault level and automatic clearing mode&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;PWMA_FCTRL0 = 0x0100U;&lt;/P&gt;&lt;P&gt;PWMA_FCTRL1 = 0x0100U;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the reference manual there are 2 x&amp;nbsp;FFILT(0/1), 2 x FSTS (0/1), 2 x FCTRL (0/1) but&amp;nbsp;for the 0s and 1s the explanation, functions and registers are exactly the same. Does it need that I need only one - either 0 or 1 register and how do you choose which one to use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. My chip has a DAC function which can be used either on its own (12-bit) but also has a 6-bit DAC on the comparator. I need to use the 12bit one, but how can I generate the trip/fault signals from the comparator to truncate the PWM? In the example code for the MC56F82xx I believe that it has been used the built-in DAC of the comparator to generate the fault signal. Any ideas how to achieve that with the external DAC synchronized with the comparator?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Comparator - which registers needs to be set?&lt;/P&gt;&lt;P&gt;CMPB_CR0&lt;/P&gt;&lt;P&gt;CMPB_CR1&lt;/P&gt;&lt;P&gt;CMPB_FPR&lt;/P&gt;&lt;P&gt;CMPV_DACCR - does it needs to be used this register when using the external 12bit DAC?&lt;/P&gt;&lt;P&gt;CMPB_MUXCR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 10:06:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Current-limit-PWM/m-p/823938#M2553</guid>
      <dc:creator>engineer12</dc:creator>
      <dc:date>2018-08-24T10:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Current-limit PWM</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Current-limit-PWM/m-p/823939#M2554</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/engineer12"&gt;engineer12&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On this community&amp;nbsp;we handle&amp;nbsp;Model-Based Design and MATLAB/Simulink related issues. Unfortunately I can't help you with your problem, but I can suggest you write this question on the Digital Signal Controller's community (&lt;A _jive_internal="true" href="https://community.nxp.com/community/dsc"&gt;here&lt;/A&gt;). I can't move your question there, you must create a new one, on that community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Razvan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 10:37:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Current-limit-PWM/m-p/823939#M2554</guid>
      <dc:creator>constantinrazva</dc:creator>
      <dc:date>2018-08-24T10:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Current-limit PWM</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Current-limit-PWM/m-p/823940#M2555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Constantin,&lt;/P&gt;&lt;P&gt;I will repost my question in the relevant section.&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2018 12:36:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Current-limit-PWM/m-p/823940#M2555</guid>
      <dc:creator>engineer12</dc:creator>
      <dc:date>2018-08-24T12:36:40Z</dc:date>
    </item>
  </channel>
</rss>

