<?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: KL25 using LLWU: crazy microcontroller in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25-using-LLWU-crazy-microcontroller/m-p/266796#M8733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Philip, thanks for your explanations. Many things I did not know, but I wonder if it is a particular behavior of &lt;A href="http://www.freescale.com/webapp/sps/site/taxonomy.jsp?code=KINETIS_L_SERIES"&gt;KL family&lt;/A&gt; or all microcontrollers act like &lt;A href="http://www.freescale.com/webapp/sps/site/taxonomy.jsp?code=KINETIS_L_SERIES"&gt;KL family&lt;/A&gt;? Where Do i find this class of technical information? ANYWAY, your answer do not explain why &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 11.818181991577148px;"&gt; if the priority of LLWU is smaller than LPTMR0 all works (without to involve NVIC)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jan 2014 13:31:03 GMT</pubDate>
    <dc:creator>stefanomanca</dc:creator>
    <dc:date>2014-01-31T13:31:03Z</dc:date>
    <item>
      <title>KL25 using LLWU: crazy microcontroller</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25-using-LLWU-crazy-microcontroller/m-p/266794#M8731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I put my &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KL2x"&gt;kl25&lt;/A&gt; in LLS mode, and I config LPTMR0 (clocked by LPO) as wake-up source, so I have two class of interrupt to config. I noted this: if the priority of LLWU is bigger than LPTMR0, the micro goes to "loop" in Cpu_INT_LLWInterrupt, it seems LLWU_F3_MWUF0 never is deleted, so it enters and exits continuously. But&amp;nbsp; if the priority of LLWU is smaller than LPTMR0 all works.&lt;/P&gt;&lt;P&gt;Very very strange.&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 11:18:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25-using-LLWU-crazy-microcontroller/m-p/266794#M8731</guid>
      <dc:creator>stefanomanca</dc:creator>
      <dc:date>2014-01-30T11:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: KL25 using LLWU: crazy microcontroller</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25-using-LLWU-crazy-microcontroller/m-p/266795#M8732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you recover from LLS with the LPTMR and the LLWU has higher priority you must clear the LPTMR pending interrupt in the LLWU ISR routine or you will get stuck in the LLWU isr loop. This is because the source of the wakeup is still present upon attempted exit from the LLWU ISR. This same phenomena will occur when recovering from VLLSx with the same priority stated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The LLWU_F3_MWUF0 is a status flag in the LLWU module and a write to it will not clear the LPTMR flag.&lt;/P&gt;&lt;P&gt;In several of the bare-metal sample code downloads you can find in the llwu_isr this code.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;&lt;P&gt;LPTMR0_CSR |=&amp;nbsp; LPTMR_CSR_TCF_MASK;&amp;nbsp;&amp;nbsp; // write 1 to TCF to clear the LPT timer compare flag&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will clear the LPTMR interrupt flag but it will not clear the LPTMR pending interrupt flag in the NVIC.&amp;nbsp; &lt;/P&gt;&lt;P&gt;If you added this statement with the appropriate interrupt number to the LLWU isr&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;NVIC_ICPR |= 1 &amp;lt;&amp;lt; (irq%32);&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then both the LPTMR interrupt flag in the LPTMR and the NVIC pending interrupt will be cleared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do this write to the NVIC_ICPR flag to quickly after the LPTMR0_CSR write it may not clear.&amp;nbsp; This has to do with the serialization of the flag clearing.&amp;nbsp; You must clear the LPTMR flag, veryify it is clear then clear the NVIC ICPR flag for the LPTMR.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the write to&amp;nbsp; NVIC_ICPR is not done in the LLWU ISR upon exit from the LLWU ISR the LPTMR interrupt service routine will be fetched. Even though the LPTMR flag is cleared by the LLWU clearing the pending interrupt the NVIC will still have a pending flag and force the call of the LPTMR ISR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Note: the act of taking the interrupt vector, clearing the flag if it is set and exiting the interrupt routine clears the Pending Interrupt flag in the NVIC_ICPR register. This is evident in the NMI isr.&amp;nbsp; There is no way to clear the NMI clear pending interrupt flag aside from entering and exiting the NMI interrupt service routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AN4503 touches on some of this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps&lt;/P&gt;&lt;P&gt;PDrake&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2014 17:38:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25-using-LLWU-crazy-microcontroller/m-p/266795#M8732</guid>
      <dc:creator>philip_drake</dc:creator>
      <dc:date>2014-01-30T17:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: KL25 using LLWU: crazy microcontroller</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25-using-LLWU-crazy-microcontroller/m-p/266796#M8733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Philip, thanks for your explanations. Many things I did not know, but I wonder if it is a particular behavior of &lt;A href="http://www.freescale.com/webapp/sps/site/taxonomy.jsp?code=KINETIS_L_SERIES"&gt;KL family&lt;/A&gt; or all microcontrollers act like &lt;A href="http://www.freescale.com/webapp/sps/site/taxonomy.jsp?code=KINETIS_L_SERIES"&gt;KL family&lt;/A&gt;? Where Do i find this class of technical information? ANYWAY, your answer do not explain why &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 11.818181991577148px;"&gt; if the priority of LLWU is smaller than LPTMR0 all works (without to involve NVIC)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jan 2014 13:31:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25-using-LLWU-crazy-microcontroller/m-p/266796#M8733</guid>
      <dc:creator>stefanomanca</dc:creator>
      <dc:date>2014-01-31T13:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: KL25 using LLWU: crazy microcontroller</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25-using-LLWU-crazy-microcontroller/m-p/266797#M8734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the reference manual for &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KL2x"&gt;KL25&lt;/A&gt;, (I will use as example the reference manual attached) you will find on the section &lt;STRONG&gt;7.3 Power modes&lt;/STRONG&gt;, the table &lt;STRONG&gt;Table 7-1. Chip power modes&lt;/STRONG&gt; where you will find the note below in reference to &lt;STRONG&gt;LLS&lt;/STRONG&gt; state:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;NOTE&lt;/STRONG&gt;: The LLWU interrupt must not be masked by the interrupt&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;controller to avoid a scenario where the system does not fully&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;exit stop mode on an LLS recovery.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;This in order to keep the LLWU interrupt with the appropriate priority to avoid the loop.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a nice day :P,&lt;BR /&gt;Perla&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 19:02:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25-using-LLWU-crazy-microcontroller/m-p/266797#M8734</guid>
      <dc:creator>perlam_i_au</dc:creator>
      <dc:date>2014-02-27T19:02:54Z</dc:date>
    </item>
  </channel>
</rss>

