<?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: LPC55S69 IRQ Numbers for NMI in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-IRQ-Numbers-for-NMI/m-p/1724981#M54127</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/70637"&gt;@PhilV&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes you are correct, the IRQn values can be found on table 8, also you can look at them on the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;LPC55S69_cm33_core0.h&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;file on a SDK example&amp;nbsp;project.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;How do I write the interrupt handler (in C++) for the NMI? - I don't see any examples of what format / structure it should be in?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The interrupt handler has to be written on C, and we do not have any examples that enables the NMI on a pin, however you can look into the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;lpcxpresso55s69_pint_pin_interrupt&lt;/STRONG&gt;&lt;/EM&gt; example and you will have to write the configuration of the NMI on the respective registers, you can look the structure of the SYSCON here:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Miguel04_0-1695073072484.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/241489i5305A5B3A8351A88/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Miguel04_0-1695073072484.png" alt="Miguel04_0-1695073072484.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have already posted a reply on your other question&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/MCUXpresso-Config-Tools/LPC55S69-GPIO-Pin-as-NMI/m-p/1723850/highlight/false#M1722" target="_self"&gt;LPC55S69 - GPIO Pin as NMI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I hope it helps.&lt;/P&gt;
&lt;P&gt;Best Regards, Miguel.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Sep 2023 21:38:52 GMT</pubDate>
    <dc:creator>Miguel04</dc:creator>
    <dc:date>2023-09-18T21:38:52Z</dc:date>
    <item>
      <title>LPC55S69 IRQ Numbers for NMI</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-IRQ-Numbers-for-NMI/m-p/1723892#M54111</link>
      <description>&lt;P&gt;I am trying to use the NMI in the LPC55S69, and the User Manual has this section:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PhilV_0-1694776445370.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/241211i76785C71EF1D5231/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PhilV_0-1694776445370.png" alt="PhilV_0-1694776445370.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the paragraph text it indicates that Table 44 gives "a list of all the peripheral interrupts and their IRQ numbers", however Table 44 (which appears immediately after) is actually a description of the NMISRC register.&lt;/P&gt;&lt;P&gt;Should it perhaps refer to "Table 8. Connection of interrupt sources to the NVIC" ?&amp;nbsp;&lt;BR /&gt;Are&amp;nbsp;&lt;EM&gt;those&lt;/EM&gt; the IRQ numbers that should be used in the NMISRC register?&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;UPDATE&lt;/STRONG&gt;&lt;BR /&gt;Edit, so lets say I have PIO1_18 set in the pins config tool for "PIN:PINT,0", and in the Peripherals tool I have it setup for a Falling Edge interrupt event, and I don't "Enable callback/interrupt" (since the 'Remark' in the User Manual above says you shouldn't).&lt;/P&gt;&lt;P&gt;I then disable NMIENCPU0, set IRQCPU0 to '4' (which I think is the correct value based on Table 8), and then re-enable NMIENCPU0:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PhilV_0-1694778567213.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/241214i23F8847379FB34AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PhilV_0-1694778567213.png" alt="PhilV_0-1694778567213.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How do I write the interrupt handler (in C++) for the NMI? - I don't see any examples of what format / structure it should be in?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 11:50:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-IRQ-Numbers-for-NMI/m-p/1723892#M54111</guid>
      <dc:creator>PhilV</dc:creator>
      <dc:date>2023-09-15T11:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 IRQ Numbers for NMI</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-IRQ-Numbers-for-NMI/m-p/1724981#M54127</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/70637"&gt;@PhilV&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes you are correct, the IRQn values can be found on table 8, also you can look at them on the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;LPC55S69_cm33_core0.h&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;file on a SDK example&amp;nbsp;project.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;How do I write the interrupt handler (in C++) for the NMI? - I don't see any examples of what format / structure it should be in?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The interrupt handler has to be written on C, and we do not have any examples that enables the NMI on a pin, however you can look into the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;lpcxpresso55s69_pint_pin_interrupt&lt;/STRONG&gt;&lt;/EM&gt; example and you will have to write the configuration of the NMI on the respective registers, you can look the structure of the SYSCON here:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Miguel04_0-1695073072484.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/241489i5305A5B3A8351A88/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Miguel04_0-1695073072484.png" alt="Miguel04_0-1695073072484.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have already posted a reply on your other question&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/MCUXpresso-Config-Tools/LPC55S69-GPIO-Pin-as-NMI/m-p/1723850/highlight/false#M1722" target="_self"&gt;LPC55S69 - GPIO Pin as NMI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I hope it helps.&lt;/P&gt;
&lt;P&gt;Best Regards, Miguel.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 21:38:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-IRQ-Numbers-for-NMI/m-p/1724981#M54127</guid>
      <dc:creator>Miguel04</dc:creator>
      <dc:date>2023-09-18T21:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55S69 IRQ Numbers for NMI</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-IRQ-Numbers-for-NMI/m-p/1727969#M54184</link>
      <description>&lt;P&gt;Many thanks&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/206759"&gt;@Miguel04&lt;/a&gt;&amp;nbsp;, the below is now for my reference, and anyone else that follows in my footsteps.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Connect the GPIO to the PINT peripheral (can do this in Pin Config tool)&lt;/LI&gt;&lt;LI&gt;In Peripheral Config tool for PINT configure the interrupt characteristic (falling edge, rising edge etc); do NOT enable the callback / interrupt (otherwise you'll end up potentially trying to handle it twice)&lt;/LI&gt;&lt;LI&gt;In main() function reconfigure the NMI registers to map the appropriate PINT interrupt to NMI:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;    /* Setup NMI interrupt for ANALOG_SW current trip event
     *
     * According to LPC55 User Manual section 4.5.6:
     * To change the interrupt source for the NMI, the NMI source must first be
     * disabled by writing 0 to the NMIEN bit. Then change the source by updating the IRQN bits
     * and re-enabling the NMI source by setting NMIEN.
     */
    SYSCON-&amp;gt;NMIsrc=(SYSCON-&amp;gt;NMISRC &amp;amp; ~SYSCON_NMISRC_NMIENCPU0_MASK);                                      // DISABLE IT
    SYSCON-&amp;gt;NMIsrc=(SYSCON-&amp;gt;NMISRC &amp;amp; ~SYSCON_NMISRC_IRQCPU0_MASK) | SYSCON_NMISRC_IRQCPU0(PIN_INT0_IRQn); // Set the NMI to PIN_INT0_IRQn
    SYSCON-&amp;gt;NMIsrc=(SYSCON-&amp;gt;NMISRC &amp;amp; ~SYSCON_NMISRC_NMIENCPU0_MASK) | SYSCON_NMISRC_NMIENCPU0(1);         // ENABLE IT
​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;startup_lpc55s69_cm33_core0.cpp describes the ".isr_vector" table, and NMI interrupt can be see as "NMI_Handler"&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;Somewhere&lt;/EM&gt; in your code write the NMI handler - note that if you don't 'hang' in this handler then you must clear the interrupt flag that triggered it (since the standard interrupt handler won't now be doing that for you), otherwise you'll just keep re-entering the NMI handler:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/**
 * Handler for the non-maskable interrupt
 */
void NMI_Handler(void)
{
//    printf("NMI Handler hit\n");
    
    // Pin specific NMI handling for falling edge
    if(PINT_PinInterruptGetFallFlag(PINT, kPINT_PinInt0))
    {
        // Do useful stuff
        // ...
        // ...

        /* Edge sensitive: clear Pin interrupt */
        PINT_PinInterruptClrStatus(PINT, kPINT_PinInt0);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 06:59:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55S69-IRQ-Numbers-for-NMI/m-p/1727969#M54184</guid>
      <dc:creator>PhilV</dc:creator>
      <dc:date>2024-04-02T06:59:37Z</dc:date>
    </item>
  </channel>
</rss>

