<?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>LPC MicrocontrollersのトピックRe: LPC11U67 PININT confusion or Bug?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11U67-PININT-confusion-or-Bug/m-p/544622#M12917</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jdupre on Wed May 04 12:55:53 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I struggled with this too, but on an LPC1517.&amp;nbsp; The user manual is correct in describing the registers, but the LPCOpen function names are very misleading when using level triggered interrupts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using an LPC1517 with 3 push-buttons wired to 3 separate pin interrupt inputs.&amp;nbsp; The input is normally high, it goes low when the button is pressed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;/* When using level sensitive interrupts, some LPCOpen function names are misleading: */
/* Next function sets level sensitive inputs (ISEL register) */
Chip_PININT_SetPinModeLevel(LPC_GPIO_PIN_INT, (SW_UP_PINTCH | SW_DOWN_PINTCH | SW_MODE_PINTCH) );
/* Next function enables level sensitive interrupts (HIGH or LOW) when level sensitive interrupts are used.
 * (by setting bits in IENR.) It does not define the level that triggers the interrupt.&amp;nbsp; */
Chip_PININT_EnableIntHigh(LPC_GPIO_PIN_INT, (SW_UP_PINTCH | SW_DOWN_PINTCH | SW_MODE_PINTCH) );
/* Next function sets a level sensitive interrupt to trigger when input is LOW. (Clears IENF bits.)&amp;nbsp; */
Chip_PININT_DisableIntLow(LPC_GPIO_PIN_INT, (SW_UP_PINTCH | SW_DOWN_PINTCH | SW_MODE_PINTCH) );&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:45:30 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:45:30Z</dc:date>
    <item>
      <title>LPC11U67 PININT confusion or Bug?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11U67-PININT-confusion-or-Bug/m-p/544621#M12916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Belias on Thu Jun 26 05:07:33 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to the LPC11U67, and currently I'm getting the interrupts to work as level interrupts (for high input level).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used the LPCOpen example codes as a reference, but there is only the example for edge interrupts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my first attempt was: &lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;Chip_SYSCTL_SetPinInterrupt(ACC_PINT_CHANNEL, ACC_INT2_PORT, ACC_INT2_PIN);
Chip_PININT_ClearIntStatus(LPC_PININT, PININTCH(ACC_PINT_CHANNEL));
Chip_PININT_SetPinModeLevel(LPC_PININT, PININTCH(ACC_PINT_CHANNEL));
Chip_PININT_EnableIntHigh(LPC_PININT, PININTCH(ACC_PINT_CHANNEL));
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;which did not work. Then while reading the Datasheet i figured out, that &lt;/SPAN&gt;&lt;STRONG&gt;Chip_PININT_ClearIntStatus&lt;/STRONG&gt;&lt;SPAN&gt; inverts the level which the interrupt should respond to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok next try: &lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;Chip_SYSCTL_SetPinInterrupt(ACC_PINT_CHANNEL, ACC_INT2_PORT, ACC_INT2_PIN);
Chip_PININT_SetPinModeLevel(LPC_PININT, PININTCH(ACC_PINT_CHANNEL));
Chip_PININT_EnableIntHigh(LPC_PININT, PININTCH(ACC_PINT_CHANNEL));
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;(clearing a level interrupt does not make sense anyways, so i thought it would be fine now)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But this did not work either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Experimenting led me to this solution. No other solution did work for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;Chip_SYSCTL_SetPinInterrupt(ACC_PINT_CHANNEL, ACC_INT2_PORT, ACC_INT2_PIN);
Chip_PININT_ClearIntStatus(LPC_PININT, PININTCH(ACC_PINT_CHANNEL));
Chip_PININT_SetPinModeLevel(LPC_PININT, PININTCH(ACC_PINT_CHANNEL));
Chip_PININT_EnableIntHigh(LPC_PININT, PININTCH(ACC_PINT_CHANNEL));
Chip_PININT_EnableIntLow(LPC_PININT, PININTCH(ACC_PINT_CHANNEL));&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can not tell why this works, and it seems totaly non intuitive to me. (I also tried just to Enable Low, and invert with the clear method afterwards and everything that looked reasonable for me, but nothing worked except this)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I understanding wrong here? Or is this a Bug in either LPCOpen or the hardware itself?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Help is very much appreciated! Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:45:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11U67-PININT-confusion-or-Bug/m-p/544621#M12916</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11U67 PININT confusion or Bug?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11U67-PININT-confusion-or-Bug/m-p/544622#M12917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jdupre on Wed May 04 12:55:53 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I struggled with this too, but on an LPC1517.&amp;nbsp; The user manual is correct in describing the registers, but the LPCOpen function names are very misleading when using level triggered interrupts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using an LPC1517 with 3 push-buttons wired to 3 separate pin interrupt inputs.&amp;nbsp; The input is normally high, it goes low when the button is pressed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;/* When using level sensitive interrupts, some LPCOpen function names are misleading: */
/* Next function sets level sensitive inputs (ISEL register) */
Chip_PININT_SetPinModeLevel(LPC_GPIO_PIN_INT, (SW_UP_PINTCH | SW_DOWN_PINTCH | SW_MODE_PINTCH) );
/* Next function enables level sensitive interrupts (HIGH or LOW) when level sensitive interrupts are used.
 * (by setting bits in IENR.) It does not define the level that triggers the interrupt.&amp;nbsp; */
Chip_PININT_EnableIntHigh(LPC_GPIO_PIN_INT, (SW_UP_PINTCH | SW_DOWN_PINTCH | SW_MODE_PINTCH) );
/* Next function sets a level sensitive interrupt to trigger when input is LOW. (Clears IENF bits.)&amp;nbsp; */
Chip_PININT_DisableIntLow(LPC_GPIO_PIN_INT, (SW_UP_PINTCH | SW_DOWN_PINTCH | SW_MODE_PINTCH) );&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:45:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11U67-PININT-confusion-or-Bug/m-p/544622#M12917</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:45:30Z</dc:date>
    </item>
  </channel>
</rss>

