<?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: FRDM-KL03Z: Need Help Getting into VLLS0 and waking with LPTMR! in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-Need-Help-Getting-into-VLLS0-and-waking-with-LPTMR/m-p/642421#M38932</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;I thought I would conclude this thread. Since the last email, I learned that the LPTMR interrupt can most certainly wake the KL03 from the VLLSx sleepmodes. It needs to have an external clock running it, which is fine for my application. It doesn't make use of the LLWU module at all. I can also wake the processor from VLLSx modes with the LLWU pin interrupt. You are correct that there is no module wake-up for the KL03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;Sara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 May 2017 14:36:43 GMT</pubDate>
    <dc:creator>sarastout-grand</dc:creator>
    <dc:date>2017-05-04T14:36:43Z</dc:date>
    <item>
      <title>FRDM-KL03Z: Need Help Getting into VLLS0 and waking with LPTMR!</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-Need-Help-Getting-into-VLLS0-and-waking-with-LPTMR/m-p/642419#M38930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to put the device into deep sleep, VLLS0 mode and then wake it from an LPTMR interrupt. I'm running the LPTMR off an external source via the RTC_CLK_IN pin which works fine in the LPTMR mode. I have the following settings to put the decide to sleep:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Settings to enter VLLS0 Deep Sleep Mode&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SMC_BWR_PMPROT_AVLLS(SMC, 1); // (1) Allows any VLLSx mode&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SMC_BWR_PMPROT_AVLP(SMC, 1); //(1) VLPR, VLPW, and VLPS are allowed&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SMC_BWR_PMCTRL_STOPM(SMC, 0b100); // controls entry into the selected stop mode (VLLSx) when Sleep-Now or Sleep-On-Exit mode is entered with SLEEPDEEP=1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SMC_BWR_STOPCTRL_VLLSM(SMC, 0b000); //controls which VLLS sub-mode to enter if STOPM=VLLSx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Setting for the Low Leakage Wakeup Unit&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;LLWU_BWR_ME_WUME0(LLWU, 1); //Enables an internal module 0 as a wakeup source input for LPTMR&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Enables LLWU interrupt&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INT_SYS_EnableIRQ(LLWU_IRQn);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//Go Low Power&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCB-&amp;gt;SCR &amp;amp;= SCB_SCR_SLEEPDEEP_Msk; // Set the SLEEPDEEP bit to disable deep sleep mode - enter wait mode//&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;RTC_WR_SR(RTC, 1); //Clear this register after reset&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;LED1_OFF;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;LED2_OFF;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;LED3_OFF;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;POWER_SYS_SetMode(0, kPowerManagerPolicyForcible);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My LLWU interrupt handler is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void LLWU_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;LPTMR_BWR_CSR_TCF(LPTMR0, 1); //Clear the interrupt flag&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;//This function&amp;nbsp; clears the ACK Isolation flag. Writing one to this setting when it is set releases the I/O pads and certain peripherals to their normal run mode state.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if(PMC_BWR_REGSC_ACKISO(PMC, 1U) != 0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;PMC_BWR_REGSC_ACKISO(PMC, 1U);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCB-&amp;gt;SCR &amp;amp;= ~SCB_SCR_SLEEPDEEP_Msk; // Clear the SLEEPDEEP bit to disable deep sleep mode - enter wait mode//&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;g_bGoToSleep = 1;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing appears to happen with these settings. Do I have the settings wrong?&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;Sara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 21:10:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-Need-Help-Getting-into-VLLS0-and-waking-with-LPTMR/m-p/642419#M38930</guid>
      <dc:creator>sarastout-grand</dc:creator>
      <dc:date>2017-03-10T21:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL03Z: Need Help Getting into VLLS0 and waking with LPTMR!</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-Need-Help-Getting-into-VLLS0-and-waking-with-LPTMR/m-p/642420#M38931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Verify: "&lt;EM&gt;To use system OSC in VLLS0 it must be configured for bypass (external clock) operation&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I am aware the LPTMR is not a LLWU module wake-up source in the KL03 (which indeed has a LLWU_ME register but no actual modules that can use it). Therefore I don't think that it can be used.&lt;BR /&gt;The strange thing with the KL03 user's guide is that it says that the LPTMR can be used as a wake-up source from any low leakage mode &lt;EM&gt;as long as it is enabled as a source&lt;/EM&gt; but then it also says "This device has no LLWU module wake-up source and uses the external pin inputs only of LLWU_P4 and LLWU_P7 as wakeup source to the LLWU module."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I attempt to set this in the uTasker project I get a warning that there are &lt;SPAN style="text-decoration: underline;"&gt;no wake up modules in the KL03&lt;/SPAN&gt; (nor KL05), and only a couple of pin sources can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get into the VLLS0 I do &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;fnSetLowPowerMode(VLLS0_MODE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The details in this are:&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;SMC_STOPCTRL = (unsigned char)(SMC_STOPCTRL_VLLSM_VLLS0 | (new_lp_mode &amp;amp; LOW_POWER_OPTIONS));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;SMC_PMCTRL = (SMC_PMCTRL_RUNM_NORMAL | SMC_PMCTRL_STOPM_VLLSx);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;SYSTEM_CONTROL_REGISTER |= SLEEPDEEP;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;__sleep_mode(); // enter low power mode using wait for interrupt processor state&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where __sleep_mode() is&lt;BR /&gt;__asm__("wfi")&lt;BR /&gt;if KDS is being used.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I think you have forgotten to actually command the "wfi" instruction that is needed...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It is also usual to disable interrupts before setting sleep modes because it is "masked interrupts" that wake and not pending ones - and this avoids race states when a wake-up event already occurs when the processor moves to sleep, which could otherwise lose the wake-up event!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some possible inspirations for low power modes:&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FLLWU.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/LLWU.html&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DkWNlsAoMly4" rel="nofollow" target="_blank"&gt;https://www.youtube.com/watch?v=kWNlsAoMly4&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dv4UnfcDiaE4" rel="nofollow" target="_blank"&gt;https://www.youtube.com/watch?v=v4UnfcDiaE4&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DiZEMRiDmHzw" rel="nofollow" target="_blank"&gt;https://www.youtube.com/watch?v=iZEMRiDmHzw&lt;/A&gt;&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>Fri, 10 Mar 2017 23:57:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-Need-Help-Getting-into-VLLS0-and-waking-with-LPTMR/m-p/642420#M38931</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2017-03-10T23:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KL03Z: Need Help Getting into VLLS0 and waking with LPTMR!</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-Need-Help-Getting-into-VLLS0-and-waking-with-LPTMR/m-p/642421#M38932</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;I thought I would conclude this thread. Since the last email, I learned that the LPTMR interrupt can most certainly wake the KL03 from the VLLSx sleepmodes. It needs to have an external clock running it, which is fine for my application. It doesn't make use of the LLWU module at all. I can also wake the processor from VLLSx modes with the LLWU pin interrupt. You are correct that there is no module wake-up for the KL03.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;Sara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2017 14:36:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL03Z-Need-Help-Getting-into-VLLS0-and-waking-with-LPTMR/m-p/642421#M38932</guid>
      <dc:creator>sarastout-grand</dc:creator>
      <dc:date>2017-05-04T14:36:43Z</dc:date>
    </item>
  </channel>
</rss>

