<?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>MCUXpresso IDE中的主题 interrupts using PWM in MKV46F256VLL16</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/interrupts-using-PWM-in-MKV46F256VLL16/m-p/1228528#M6684</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to generate an interrupt using the PWM blocks. I understand that there are a few inbuilt functions that help me create this interrupt easily. But what I'm not able to understand is that how I will be able to relate that particular interrupt to the function where I would be writing the action that needs to be taken once an interrupt occurs.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 374px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/136852i7B7D0DA2F159F7C4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Capture.PNG&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;which among these inbuilt function should I be using? Is there some other function that lets me point a function that needs to be run when interrupt occurs?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Tue, 09 Feb 2021 05:34:32 GMT</pubDate>
    <dc:creator>soaring_sun</dc:creator>
    <dc:date>2021-02-09T05:34:32Z</dc:date>
    <item>
      <title>interrupts using PWM in MKV46F256VLL16</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/interrupts-using-PWM-in-MKV46F256VLL16/m-p/1228528#M6684</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to generate an interrupt using the PWM blocks. I understand that there are a few inbuilt functions that help me create this interrupt easily. But what I'm not able to understand is that how I will be able to relate that particular interrupt to the function where I would be writing the action that needs to be taken once an interrupt occurs.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 374px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/136852i7B7D0DA2F159F7C4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Capture.PNG&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;which among these inbuilt function should I be using? Is there some other function that lets me point a function that needs to be run when interrupt occurs?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 05:34:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/interrupts-using-PWM-in-MKV46F256VLL16/m-p/1228528#M6684</guid>
      <dc:creator>soaring_sun</dc:creator>
      <dc:date>2021-02-09T05:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: interrupts using PWM in MKV46F256VLL16</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/interrupts-using-PWM-in-MKV46F256VLL16/m-p/1229749#M6702</link>
      <description>&lt;P&gt;I did some digging of my own since I wasn't getting any answers any time soon. I found the solution to generate and run the interrupt smoothly. I hope this thread helps someone who's having same trouble as me.&lt;/P&gt;&lt;P&gt;&lt;U&gt;Using interrupt with the PWM.&lt;/U&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Set the PWM based on which the interrupt needs to be generated. Ex: Val 0/1/2/3/4/5. Here, PWMA defines the PWM where the interrupt needs to be generated. Select the module in the PWM and select the triggering point.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="soaring_sun_0-1613032025065.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/137020i424EE4DED7FB9ABF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="soaring_sun_0-1613032025065.png" alt="soaring_sun_0-1613032025065.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;soaring_sun_0-1613032025065.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Enable the interrupt using the already defined function. Within the parenthesis, define which is the trigger selection. Since in the above example val0 is selected, hence here it is CMP0. A NVIC priority can also be set to this, but it depends on the user and it is not mandatory.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="soaring_sun_1-1613032025072.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/137023i4F2BC75FC649B58A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="soaring_sun_1-1613032025072.png" alt="soaring_sun_1-1613032025072.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;soaring_sun_1-1613032025072.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Write the function with the corresponding heading of the interrupt handler where the instructions need to be called every time the interrupt occurs.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="soaring_sun_2-1613032025088.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/137022i7F8D2DD88EB2383B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="soaring_sun_2-1613032025088.png" alt="soaring_sun_2-1613032025088.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;soaring_sun_2-1613032025088.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Once the ISR function is written, it is important to clear the interrupt flag. For this a function called, “clear status flag” can be used where both the corresponding status and error flag are reset.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="soaring_sun_3-1613032025096.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/137024i69A19BF0E25ACCA7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="soaring_sun_3-1613032025096.png" alt="soaring_sun_3-1613032025096.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;soaring_sun_3-1613032025096.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I have missed out something or if there is more, you are more than welcome to correct me. Let me know if I have been making mistake all this while...&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 08:39:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/interrupts-using-PWM-in-MKV46F256VLL16/m-p/1229749#M6702</guid>
      <dc:creator>soaring_sun</dc:creator>
      <dc:date>2021-02-11T08:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: interrupts using PWM in MKV46F256VLL16</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/interrupts-using-PWM-in-MKV46F256VLL16/m-p/1230596#M6706</link>
      <description>&lt;P&gt;Hello &lt;A id="link_12" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/183199" target="_self"&gt;soaring_sun&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The procedure to enable the interruptions is correct, just some suggestions to add. &lt;BR /&gt;I suggest you use the IRQ handlers only to set/clear flags you've defined so you can control what functions are executed in your code, another good option is using function callbacks.&lt;/P&gt;
&lt;P&gt;If you have more questions do not hesitate to ask me.&lt;BR /&gt;Best regards,&lt;BR /&gt;Omar&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 20:06:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/interrupts-using-PWM-in-MKV46F256VLL16/m-p/1230596#M6706</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2021-02-12T20:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: interrupts using PWM in MKV46F256VLL16</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/interrupts-using-PWM-in-MKV46F256VLL16/m-p/1230683#M6707</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/169053"&gt;@Omar_Anguiano&lt;/a&gt;. I understand what you are trying to say. But if you had an example that demonstrates the same, it would be helpful.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Feb 2021 04:35:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/interrupts-using-PWM-in-MKV46F256VLL16/m-p/1230683#M6707</guid>
      <dc:creator>soaring_sun</dc:creator>
      <dc:date>2021-02-13T04:35:58Z</dc:date>
    </item>
  </channel>
</rss>

