<?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: Time need to change external interrupt from disable to enable and vice versa in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533230#M32863</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akshay,&lt;/P&gt;&lt;P&gt;well the method you use for enabling/disableing ext. irq is a bit unusual. Not sure if negate the expression make sense to clearing the IRQ filied in 32-bit word. Is your expression &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13 ^= 10U&amp;lt;&amp;lt;16&amp;nbsp;&amp;nbsp; //for disable really executed just ones after enabling the interrupt &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13 |= 10U&amp;lt;&amp;lt;16&amp;nbsp;&amp;nbsp; //for enable?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We usually use this approach:&lt;/P&gt;&lt;P&gt;to set bits flied in register&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REGISTER |= REGISTER_BITFIELD_MASK;&lt;/P&gt;&lt;P&gt;or to clearbits flied in register&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REGISTER &amp;amp;= ~REGISTER_BITFIELD_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or your case example:&lt;/P&gt;&lt;P&gt;to enable &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13 &lt;/SPAN&gt;= (&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13&lt;/SPAN&gt; &amp;amp; ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(0xA);&lt;/P&gt;&lt;P&gt;to disable &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13 &lt;/SPAN&gt;= (&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13&lt;/SPAN&gt; &amp;amp; ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(0x0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Care must be taken with status flags which are cleared by reading! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;R.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2016 08:26:53 GMT</pubDate>
    <dc:creator>rastislav_pavlanin</dc:creator>
    <dc:date>2016-08-17T08:26:53Z</dc:date>
    <item>
      <title>Time need to change external interrupt from disable to enable and vice versa</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533229#M32862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know how much time external interrupt need to change from disable(should never occur interrupt) to enable(to occur interrupt again) or vice versa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using following method to enable and disable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PORTA_PCR13 ^= 10U&amp;lt;&amp;lt;16&amp;nbsp;&amp;nbsp; //for disable&lt;/P&gt;&lt;P&gt;PORTA_PCR13 |= 10U&amp;lt;&amp;lt;16&amp;nbsp;&amp;nbsp; //for enable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I disable it and again enable it, sometimes it takes more time(I could not measure it) to occur interrupt again. &lt;/P&gt;&lt;P&gt;whether somebody know whether we need to wait for some time after enable and disable external interrupt?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Akshay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2016 15:23:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533229#M32862</guid>
      <dc:creator>akshaykatare</dc:creator>
      <dc:date>2016-08-16T15:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Time need to change external interrupt from disable to enable and vice versa</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533230#M32863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akshay,&lt;/P&gt;&lt;P&gt;well the method you use for enabling/disableing ext. irq is a bit unusual. Not sure if negate the expression make sense to clearing the IRQ filied in 32-bit word. Is your expression &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13 ^= 10U&amp;lt;&amp;lt;16&amp;nbsp;&amp;nbsp; //for disable really executed just ones after enabling the interrupt &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13 |= 10U&amp;lt;&amp;lt;16&amp;nbsp;&amp;nbsp; //for enable?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We usually use this approach:&lt;/P&gt;&lt;P&gt;to set bits flied in register&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REGISTER |= REGISTER_BITFIELD_MASK;&lt;/P&gt;&lt;P&gt;or to clearbits flied in register&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REGISTER &amp;amp;= ~REGISTER_BITFIELD_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or your case example:&lt;/P&gt;&lt;P&gt;to enable &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13 &lt;/SPAN&gt;= (&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13&lt;/SPAN&gt; &amp;amp; ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(0xA);&lt;/P&gt;&lt;P&gt;to disable &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13 &lt;/SPAN&gt;= (&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13&lt;/SPAN&gt; &amp;amp; ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(0x0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Care must be taken with status flags which are cleared by reading! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;R.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 08:26:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533230#M32863</guid>
      <dc:creator>rastislav_pavlanin</dc:creator>
      <dc:date>2016-08-17T08:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Time need to change external interrupt from disable to enable and vice versa</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533231#M32864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Rastilav pointed out the code you are showing is probably not disabling the interrupt reliably.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This document explains the internals.&amp;nbsp; It is for the M1, it applies to the M0(+) as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://infocenter.arm.com/help/topic/com.arm.doc.dai0211a/DAI0211A_interrupt_behaviour_of_cortexm1.pdf" title="http://infocenter.arm.com/help/topic/com.arm.doc.dai0211a/DAI0211A_interrupt_behaviour_of_cortexm1.pdf"&gt;http://infocenter.arm.com/help/topic/com.arm.doc.dai0211a/DAI0211A_interrupt_behaviour_of_cortexm1.pdf&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 12:17:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533231#M32864</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2016-08-17T12:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Time need to change external interrupt from disable to enable and vice versa</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533232#M32865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"... &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;to disable &lt;/SPAN&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORTA_PCR13 &lt;/SPAN&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;= (&lt;/SPAN&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORTA_PCR13&lt;/SPAN&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt; &amp;amp; ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(0x0); "&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;What is the actual point of doing the '&amp;amp; ~' style masking in assignment (=)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;It makes sense in some '&amp;amp;=' and '|=' contexts, not in assignment just wastes code space if the compiler is not optimizing it away.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 12:23:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533232#M32865</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2016-08-17T12:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Time need to change external interrupt from disable to enable and vice versa</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533233#M32866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;'&amp;amp; ~' is specifically the way to 'and away' a group of bits, as defined by a header-mask, for which you need the 'inverse' to define which bits to KEEP.&amp;nbsp; The '| 0' in this statement is indeed a bit superfluous.&amp;nbsp; The other way to write this 'clear bits' is of course &lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORTA_PCR13 &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt; ~PORT_PCR_IRQC_MASK;&amp;nbsp; Your 'exclusive-or-equals' works ONLY if you KNOW that exactly &lt;SPAN style="text-decoration: underline;"&gt;that&lt;/SPAN&gt; combo of bits were 'set' in that field prior to said statement, which sounds like a bit of a presumption.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;By the way, are you specifically trying to ignore some external-pin interrupt conditions, or just 'delay them' to more opportune timing?&amp;nbsp; Is your part M0 or M4 core?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 12:53:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533233#M32866</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2016-08-17T12:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Time need to change external interrupt from disable to enable and vice versa</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533234#M32867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;'&amp;amp; ~' is specifically the way to 'and away' a group of bits, as defined by a header-mask, ..."&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;I understand the C code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I don't understand is why all this effort to mask things that are going to be overwritten by the assignment (=) anyway?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORTA_PCR13 &lt;/SPAN&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;= (&lt;/SPAN&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORTA_PCR13&lt;/SPAN&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt; &amp;amp; ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(0x0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORTA_PCR13 &lt;/SPAN&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORT_PCR_IRQC(0x0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;both have the same outcome.&amp;nbsp; &lt;/P&gt;&lt;P&gt;A good compiler will get rid of the useless mask, a bad one will waste a lot of space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Masks in &amp;amp;= or |= may or may not be needed.&amp;nbsp; Not seeing a case where they are every needed in =.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 12:14:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533234#M32867</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2016-08-19T12:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Time need to change external interrupt from disable to enable and vice versa</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533235#M32868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not quite sure where to go with this.&amp;nbsp; The appearance of &lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORTA_PCR13 on both sides of the '=' &lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;makes for a read-modify-write operation&lt;/SPAN&gt;' (and same for the form &amp;amp;=, which is just shorthand for read-modify-write, AND for certain compilers and architectures makes it easier to make an efficient operation).&amp;nbsp; The register PORTA_PCR13 is read, 'anded' with the inverse-of-the-field-mask to 'zero' selected bits, and THEN assigned (written) back.&amp;nbsp; Given that &lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORT_PCR_IRQC_MASK is 0x000F0000, the inverse (~ operator, one's complement) will be 0xFFF0FFFF, so as to 'keep' the rest of the current register contents.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;The net result of &lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORTA_PCR13 &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt; ~PORT_PCR_IRQC_MASK;&amp;nbsp; is:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; &lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORTA_PCR13 = &lt;SPAN style="color: #51626f; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; &lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORTA_PCR13 &amp;amp; &lt;SPAN style="color: #51626f; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;0xFFF0FFFF;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;It is useful to remember that the 'C' language was created on a PDP-11, specifically to make it possible to write UNIX in 'something better than assembler' yet let compiler technology of the 70's create efficient output.&amp;nbsp; The PDP-11 HAD special read-modify-write instructions -- hence this assignment-form to let the compiler easily see the better sequence.&amp;nbsp; In a similar vein, 'conditional instruction execution' (also in ARM) led to the creation of the ? operator...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 12:50:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533235#M32868</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2016-08-19T12:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: Time need to change external interrupt from disable to enable and vice versa</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533236#M32869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"The appearance of PORTA_PCR13 on both sides of the '=' makes for a read-modify-write operation ..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm well versed in C.&amp;nbsp; Dig deep enough and you'll find my name in some GCC sources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"It is useful to remember that the 'C' language was created on a PDP-11..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are photos I took of the Large Scale Systems Museum (LSSM), Dave McGuire President/Curator, in New Kensington Pennsylvania on January 30th 2016.&amp;nbsp; See the quick walk through video I made:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fbpaddock.com%2Fdoku.php%2Flssm%2Fstart" rel="nofollow" target="_blank"&gt;http://bpaddock.com/doku.php/lssm/start&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave is expanding to two floors now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your in the area to see the LSS Museum we can debate the merit's of bit masks in contexts where they are not needed in person. :-)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 17:46:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533236#M32869</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2016-08-19T17:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Time need to change external interrupt from disable to enable and vice versa</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533237#M32870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I no longer even KNOW what us old-farts are even arguing about&amp;nbsp; :-)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All I CAN say is that if we come 'in' with PORTA_PCR13 as 0x00_04_01_77 (underscores are mine, of course) THEN&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTA_PCR13 &lt;/SPAN&gt;= (&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13&lt;/SPAN&gt; &amp;amp; ~PORT_PCR_IRQC_MASK) | PORT_PCR_IRQC(0xA);&lt;/P&gt;&lt;P&gt;will make it into 0x00_0A_01_77 by clearing the appropriate nibble, then 'popping in' the 'A' there (falling edge mode), while&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORTA_PCR13 &lt;/SPAN&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORT_PCR_IRQC(0x0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;will make it all zero 0x00_00_00_00, disabling the pin (etc).&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;What the compiler can 'optimize away' is 'limited', at LEAST in this case, by the declaration of this (and MOST chip registers) as VOLATILE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;It is indeed worth re-iterating here an earlier warning about 'clearing control bits' using this kind of read-modify-write.&amp;nbsp; That is, IF this 'read' shows an active interrupt ISF, as in 0x01 in the first byte, THEN leaving that bit as a 'one' in your write-back WILL clear the interrupt on you, presumably 'unhandled'.&amp;nbsp; These 'write one to clear' register bits are especially tricky for that, and even Freescale boiler-plate code falls victim to it at times.&amp;nbsp; Other register-flag bits (in other contexts) can be cleared SIMPLY by 'reading'...&amp;nbsp; Finding such a 'very rare fault' that hits right in the 'problem window' is irritating indeed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;So what this 'enable' statement would REALLY need to be is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTA_PCR13 &lt;/SPAN&gt;= (&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;PORTA_PCR13&lt;/SPAN&gt; &amp;amp; ~(PORT_PCR_IRQC_MASK | &lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;PORT_PCR_ISF_MASK)&lt;/SPAN&gt;) | PORT_PCR_IRQC(0xA);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;so that we 'and off' a potential interrupt-status-indication as well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;Just to put the 'final nail' in this thing, this is a debug-listing/trace with added annotations:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE height="236" style="width: 1136px; height: 214px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;PORTA_PCR13 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK | PORT_PCR_PE_MASK | PORT_PCR_PS_MASK ;&lt;/TD&gt;&lt;TD&gt;// Initialize PCR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x424a: 0xf8df 0x093c&lt;/TD&gt;&lt;TD&gt;LDR.W R1, ??DataTable76_16&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;; PORTA_PORTA_PCR13&lt;/P&gt;&lt;P&gt;&amp;nbsp; 32bit constants are loaded PC-relative&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x424e: 0xf240 0x1143&lt;/TD&gt;&lt;TD&gt;MOVW&amp;nbsp; R0, #323&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;; 0x143 ;Short constant, in instruction&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x4252: 0x6001&lt;/TD&gt;&lt;TD&gt;STR&amp;nbsp;&amp;nbsp; R0, [R1]&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE height="564" style="width: 1151px; height: 565px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;PORTA_PCR13 = (PORTA_PCR13 &amp;amp; ~(PORT_PCR_IRQC_MASK | PORT_PCR_ISF_MASK)) | PORT_PCR_IRQC(0xA);&lt;/TD&gt;&lt;TD&gt;//ENABLE PIN INTERRUPT&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x424e: 0xf8df 0x0938&lt;/TD&gt;&lt;TD&gt;LDR.W R0, ??DataTable76_17&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;; 0xfef0ffff (-17760257)&lt;/P&gt;&lt;P&gt;This is our combined mask.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x4252: 0x680a&lt;/TD&gt;&lt;TD&gt;LDR&amp;nbsp;&amp;nbsp; R2, [R1]&lt;/TD&gt;&lt;TD&gt;;Fetch port for RMW.&amp;nbsp; R2=0x143&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x4258: 0x4002&lt;/TD&gt;&lt;TD&gt;ANDS&amp;nbsp; R2, R2, R0&lt;/TD&gt;&lt;TD&gt;;Clear the IRQC bits, avoid ISF&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x425a: 0xf442 0x2220&lt;/TD&gt;&lt;TD&gt;ORR.W R2, R2, #655360&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;; 0xa0000 ;'simple' constant, fits in instruction&lt;/P&gt;&lt;P&gt;R2=0x000A_0143&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x425e: 0x600a&lt;/TD&gt;&lt;TD&gt;STR&amp;nbsp;&amp;nbsp; R2, [R1]&lt;/TD&gt;&lt;TD&gt;; and finally the write-back&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;PORTA_PCR13 &amp;amp;= ~(PORT_PCR_IRQC_MASK | PORT_PCR_ISF_MASK);&lt;/TD&gt;&lt;TD&gt;//DISABLE PIN INTERRUPT&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x4260: 0x680a&lt;/TD&gt;&lt;TD&gt;LDR&amp;nbsp;&amp;nbsp; R2, [R1]&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x4266: 0x4010&lt;/TD&gt;&lt;TD&gt;ANDS&amp;nbsp; R0, R0, R2&lt;/TD&gt;&lt;TD&gt;;This RMW just clears bits&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x4268: 0x6008&lt;/TD&gt;&lt;TD&gt;STR&amp;nbsp;&amp;nbsp; R0, [R1]&lt;/TD&gt;&lt;TD&gt;;R0 = 0x143&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;PORTA_PCR13 = PORT_PCR_IRQC(0);&lt;/TD&gt;&lt;TD&gt;//CLEARS PCR&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x426a: 0x2000&lt;/TD&gt;&lt;TD&gt;MOVS&amp;nbsp; R0, #0&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;0x426c: 0x6008&lt;/TD&gt;&lt;TD&gt;STR&amp;nbsp;&amp;nbsp; R0, [R1]&lt;/TD&gt;&lt;TD&gt;; The simple 'assignment only' to ALL ZERO&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2016 19:32:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Time-need-to-change-external-interrupt-from-disable-to-enable/m-p/533237#M32870</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2016-08-19T19:32:15Z</dc:date>
    </item>
  </channel>
</rss>

