<?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: LPC4330 GPIO Pin Interrupt in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-GPIO-Pin-Interrupt/m-p/997364#M39235</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ended up figuring out what the problem was - schematic was mislabeled. But for those that are curious how to do it, here's how I did it for pin PB_2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#define CPU_PORT 11&lt;BR /&gt;#define CPU_PORT_PIN 0&lt;BR /&gt;#define GPIO_PORT 5&lt;BR /&gt;#define GPIO_PIN 22&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Setup CPU port 11, pin 0, with an input buffer, pull down resistor, and function 4 mode.&lt;BR /&gt; Chip_SCU_PinMuxSet(CPU_PORT, CPU_PORT_PIN, (SCU_MODE_INBUFF_EN | SCU_MODE_PULLDOWN | SCU_MODE_FUNC4));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set GPIO port 5, pin 22, as an input&lt;BR /&gt; Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, GPIO_PORT, GPIO_PIN);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set GPIO port 5, pin 22, as an pin for CPU pin interrupt port 0&lt;BR /&gt; Chip_SCU_GPIOIntPinSel(0, GPIO_PORT, GPIO_PIN);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Clear any pending interrupts on CPU pin interrupt port 0&lt;BR /&gt; Chip_PININT_ClearIntStatus(LPC_GPIO_PIN_INT, PININTCH0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set CPU pin interrupt port 0 as edge sensitive&lt;BR /&gt; Chip_PININT_SetPinModeEdge(LPC_GPIO_PIN_INT, PININTCH0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set CPU pin interrupt port 0 as high enabled&lt;BR /&gt; Chip_PININT_EnableIntHigh(LPC_GPIO_PIN_INT, PININTCH0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Clear any pending interrupts in the NVIC for CPU pin interrupts on port 0&lt;BR /&gt; NVIC_ClearPendingIRQ(PIN_INT0_IRQn);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Enable the interrupts in the NVIC for CPU pin interrupts on port 0&lt;BR /&gt; NVIC_EnableIRQ(PIN_INT0_IRQn);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Torin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Nov 2019 17:06:19 GMT</pubDate>
    <dc:creator>C-Coder</dc:creator>
    <dc:date>2019-11-19T17:06:19Z</dc:date>
    <item>
      <title>LPC4330 GPIO Pin Interrupt</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-GPIO-Pin-Interrupt/m-p/997361#M39232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We're using an&amp;nbsp;LPC4330FET180 and I want to get a GPIO interrupt on pin D4. D4 maps to P4_0 or GPIO2[0] in the user's manual. Assuming the electrical side of things is correct, I'm questioning my software setup code. We have the pin brought out to a debug pin that I can watch with the scope. The scope is showing an interrupt when I expect one, but I'm never hitting the handler in the software. I pretty much cut/paste the code from periph_pinint and have this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="font-size: 13px;"&gt;#define INT_PORT 2&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;#define INT_PIN 0&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; Chip_SCU_PinMuxSet(INT_PORT, INT_PIN, (SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC0));&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, INT_PORT, INT_PIN); // Output&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; Chip_SCU_GPIOIntPinSel(0, INT_PORT, INT_PIN);&lt;/SPAN&gt;

&lt;SPAN style="font-size: 13px;"&gt; Chip_PININT_ClearIntStatus(LPC_GPIO_PIN_INT, PININTCH(0));&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; Chip_PININT_SetPinModeEdge(LPC_GPIO_PIN_INT, PININTCH(0));&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; Chip_PININT_EnableIntHigh(LPC_GPIO_PIN_INT, PININTCH(0));&lt;/SPAN&gt;

&lt;SPAN style="font-size: 13px;"&gt; NVIC_ClearPendingIRQ(PIN_INT0_IRQn);&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; NVIC_EnableIRQ(PIN_INT0_IRQn);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Torin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2019 15:43:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-GPIO-Pin-Interrupt/m-p/997361#M39232</guid>
      <dc:creator>C-Coder</dc:creator>
      <dc:date>2019-11-15T15:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4330 GPIO Pin Interrupt</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-GPIO-Pin-Interrupt/m-p/997362#M39233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Debugging through the code some more and looking at memory values, it would appear that to use P4_0, I really want the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#define INT_PORT 4&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;rather than&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#define INT_PORT 2&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, even after changing that, I still don't hit a break point in the handler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Torin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2019 21:47:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-GPIO-Pin-Interrupt/m-p/997362#M39233</guid>
      <dc:creator>C-Coder</dc:creator>
      <dc:date>2019-11-15T21:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4330 GPIO Pin Interrupt</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-GPIO-Pin-Interrupt/m-p/997363#M39234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did also notice that I needed to change&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, INT_PORT, INT_PIN); // Output&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, INT_PORT, INT_PIN);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But am still not getting hitting the handler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Torin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2019 15:06:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-GPIO-Pin-Interrupt/m-p/997363#M39234</guid>
      <dc:creator>C-Coder</dc:creator>
      <dc:date>2019-11-18T15:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4330 GPIO Pin Interrupt</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-GPIO-Pin-Interrupt/m-p/997364#M39235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ended up figuring out what the problem was - schematic was mislabeled. But for those that are curious how to do it, here's how I did it for pin PB_2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#define CPU_PORT 11&lt;BR /&gt;#define CPU_PORT_PIN 0&lt;BR /&gt;#define GPIO_PORT 5&lt;BR /&gt;#define GPIO_PIN 22&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Setup CPU port 11, pin 0, with an input buffer, pull down resistor, and function 4 mode.&lt;BR /&gt; Chip_SCU_PinMuxSet(CPU_PORT, CPU_PORT_PIN, (SCU_MODE_INBUFF_EN | SCU_MODE_PULLDOWN | SCU_MODE_FUNC4));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set GPIO port 5, pin 22, as an input&lt;BR /&gt; Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, GPIO_PORT, GPIO_PIN);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set GPIO port 5, pin 22, as an pin for CPU pin interrupt port 0&lt;BR /&gt; Chip_SCU_GPIOIntPinSel(0, GPIO_PORT, GPIO_PIN);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Clear any pending interrupts on CPU pin interrupt port 0&lt;BR /&gt; Chip_PININT_ClearIntStatus(LPC_GPIO_PIN_INT, PININTCH0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set CPU pin interrupt port 0 as edge sensitive&lt;BR /&gt; Chip_PININT_SetPinModeEdge(LPC_GPIO_PIN_INT, PININTCH0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Set CPU pin interrupt port 0 as high enabled&lt;BR /&gt; Chip_PININT_EnableIntHigh(LPC_GPIO_PIN_INT, PININTCH0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Clear any pending interrupts in the NVIC for CPU pin interrupts on port 0&lt;BR /&gt; NVIC_ClearPendingIRQ(PIN_INT0_IRQn);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Enable the interrupts in the NVIC for CPU pin interrupts on port 0&lt;BR /&gt; NVIC_EnableIRQ(PIN_INT0_IRQn);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Torin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2019 17:06:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-GPIO-Pin-Interrupt/m-p/997364#M39235</guid>
      <dc:creator>C-Coder</dc:creator>
      <dc:date>2019-11-19T17:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4330 GPIO Pin Interrupt</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-GPIO-Pin-Interrupt/m-p/997365#M39236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad you were able to resolve thi quickly. Also, thank you for providing the answer!&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sabina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2019 22:17:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4330-GPIO-Pin-Interrupt/m-p/997365#M39236</guid>
      <dc:creator>Sabina_Bruce</dc:creator>
      <dc:date>2019-11-19T22:17:42Z</dc:date>
    </item>
  </channel>
</rss>

