<?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>Kinetis Microcontrollers中的主题 Re: Why ISR gets missed</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-ISR-gets-missed/m-p/870728#M51869</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which Register do we need to configure to increase priority of Pin 3(PTE 2)  of MK60FN1M0VLQ12?&lt;/P&gt;&lt;P&gt;We are loosing change to 1 state. This is because interrupt pin is HIGH, when we see ISR routine stop getting called. And ISR was called few times before that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is our ISR.&lt;/P&gt;&lt;P&gt;PE_ISR(EInt1_Interrupt)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;  /* {Default RTOS Adapter} ISR parameter is passed through the global variable */&lt;/P&gt;&lt;P&gt;  EInt1_TDeviceDataPtr DeviceDataPrv = INT_PORTE__DEFAULT_RTOS_ISRPARAM;&lt;/P&gt;&lt;P&gt;  PORT_PDD_ClearPinInterruptFlag(PORTE_BASE_PTR, EInt1_PIN_INDEX);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  EInt1_OnInterrupt(DeviceDataPrv-&amp;gt;UserData);&lt;/P&gt;&lt;P&gt;  //PORT_PDD_ClearPinInterruptFlag(PORTE_BASE_PTR, EInt1_PIN_INDEX);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void EInt1_OnInterrupt(LDD_TUserData *UserDataPtr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;if (int_cnt0 &amp;lt; 900)&lt;/P&gt;&lt;P&gt;  {&lt;/P&gt;&lt;P&gt;    adxl_xyz[int_cnt0] = adxl_read_XYZ_opt();&lt;/P&gt;&lt;P&gt;    int_cnt0++;&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  else&lt;/P&gt;&lt;P&gt;    int_cnt0 = 0;&lt;/P&gt;&lt;P&gt;// adxl_interrupt_enable();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Smita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Jan 2019 08:30:07 GMT</pubDate>
    <dc:creator>smita_joshi</dc:creator>
    <dc:date>2019-01-12T08:30:07Z</dc:date>
    <item>
      <title>Why ISR gets missed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-ISR-gets-missed/m-p/870726#M51867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;We have configured MK60FN1M0VLQ12 Pin 3(PTE 2) as an input pin for interrupt&amp;nbsp;via SPI interface. We have configured interrupt on rising edge. We&amp;nbsp;see that ISR gets called 4 -5 times and after that ISR gets missed. And in oscilloscope we see that interrupt pin is HIGH.&lt;/P&gt;&lt;P&gt;What could be the issue? Why ISR gets missed out?&lt;/P&gt;&lt;P&gt;How to increase interrupt priority of PTE2?&amp;nbsp;We&amp;nbsp;have tried disabling other interrupts but the issue persist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Smita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 10:41:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-ISR-gets-missed/m-p/870726#M51867</guid>
      <dc:creator>smita_joshi</dc:creator>
      <dc:date>2019-01-11T10:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why ISR gets missed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-ISR-gets-missed/m-p/870727#M51868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Smita&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The priority of the port pin interrupt is set by the level that you define for the PTE source; Level 0 gives it highest priority.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have very fast changes it is possible to miss interrupts but it shouldn't be possible to lose a change to the '1' state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check your code carefully to ensure that you clear the original pending interrupt as early as possible in the interrupt handler so that a following change can become pending again, which will reduce the chance of missing edges - don't clear it after the interrupt handler has done its work or waiting for it to return to 0 since this may introduce a race state and risk clearing a pending interrupt that has not been handled..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the port interrupt code from the uTasker project (compatible with all Kinetis devices, including interrupts in KE/KEA parts) for comparison with an industrially proven solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;Complete K60 solutions, training and support:&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Kinetis K60:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTWR-K60N512.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60N512.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTWR-K60D100M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60D100M.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTWR-K60F120M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60F120M.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FELZET80_NET-KBED.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/ELZET80_NET-KBED.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FELZET80_NET-K60.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/ELZET80_NET-K60.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 19:18:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-ISR-gets-missed/m-p/870727#M51868</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-01-11T19:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why ISR gets missed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-ISR-gets-missed/m-p/870728#M51869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which Register do we need to configure to increase priority of Pin 3(PTE 2)  of MK60FN1M0VLQ12?&lt;/P&gt;&lt;P&gt;We are loosing change to 1 state. This is because interrupt pin is HIGH, when we see ISR routine stop getting called. And ISR was called few times before that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is our ISR.&lt;/P&gt;&lt;P&gt;PE_ISR(EInt1_Interrupt)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;  /* {Default RTOS Adapter} ISR parameter is passed through the global variable */&lt;/P&gt;&lt;P&gt;  EInt1_TDeviceDataPtr DeviceDataPrv = INT_PORTE__DEFAULT_RTOS_ISRPARAM;&lt;/P&gt;&lt;P&gt;  PORT_PDD_ClearPinInterruptFlag(PORTE_BASE_PTR, EInt1_PIN_INDEX);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  EInt1_OnInterrupt(DeviceDataPrv-&amp;gt;UserData);&lt;/P&gt;&lt;P&gt;  //PORT_PDD_ClearPinInterruptFlag(PORTE_BASE_PTR, EInt1_PIN_INDEX);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void EInt1_OnInterrupt(LDD_TUserData *UserDataPtr)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;if (int_cnt0 &amp;lt; 900)&lt;/P&gt;&lt;P&gt;  {&lt;/P&gt;&lt;P&gt;    adxl_xyz[int_cnt0] = adxl_read_XYZ_opt();&lt;/P&gt;&lt;P&gt;    int_cnt0++;&lt;/P&gt;&lt;P&gt;  }&lt;/P&gt;&lt;P&gt;  else&lt;/P&gt;&lt;P&gt;    int_cnt0 = 0;&lt;/P&gt;&lt;P&gt;// adxl_interrupt_enable();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Smita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jan 2019 08:30:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-ISR-gets-missed/m-p/870728#M51869</guid>
      <dc:creator>smita_joshi</dc:creator>
      <dc:date>2019-01-12T08:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why ISR gets missed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-ISR-gets-missed/m-p/870729#M51870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Smita&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can set an interrupt priority for each port (not each pin). To set the priority on port E on the K60 you write the value to the corresponding NVIC register.&lt;/P&gt;&lt;P&gt;Eg. For level 6 the value is (6 &amp;lt;&amp;lt; 4) is written to the IRQ91 PRIORITY REGISTER (which is in the IRQ88_91_PRIORITY_REGISTER in the NVIC).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From your description I am not yet convinced that you are losing interrupts and it could instead be a measurement problem: The fact that the input is '1' and you have had several interrupt doesn't report a problem in itself because there is no evidence as to whether the last change to '1' was counted or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you prove that the final rising edge was not handled?&lt;/P&gt;&lt;P&gt;Do you, for example, have a logic analyser recording of the input and an output being toggle on each handled interrupt, or set during the interrupt handling routine? Such a recording would be (fairly reliable) proof and may also show the reason for it at the same time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jan 2019 16:28:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Why-ISR-gets-missed/m-p/870729#M51870</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-01-13T16:28:09Z</dc:date>
    </item>
  </channel>
</rss>

