<?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: Re: Problems putting KL03 into VLPS and reducing power consumption</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359378#M18151</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Will,&lt;/P&gt;&lt;P&gt;I was wondering if you can share the whole demo, then I can run it with FRDM-KL03 board for checking.&lt;/P&gt;&lt;P&gt;I'm looking forward to your reply.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&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>Tue, 31 Mar 2015 06:41:03 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2015-03-31T06:41:03Z</dc:date>
    <item>
      <title>Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359370#M18143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;1. What I'm trying to do:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;a- Put KL03 into VLPS mode&lt;/P&gt;&lt;P&gt;b- Switch from using the 48MHz HIRC to the 2MHz LIRC2M&lt;/P&gt;&lt;P&gt;c- Reduce power consumption from a few mA's to something lower than 100uA&lt;/P&gt;&lt;P&gt;d- Go from VLPS back to RUN mode on an SPI slave mode receive through AWIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;2. How I'm doing it:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;a- Here are the 2 functions I am using to enter and exit VLPS:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void vlps_enter(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMC_PMCTRL = SMC_PMCTRL_STOPM(2));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dummyread = SMC_PMCTRL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)dummyread;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB_SCR |= SCB_SCR_SLEEPDEEP_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dsb();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wfi();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isb();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void vlps_exit(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMC_PMCTRL &amp;amp;= ~SMC_PMCTRL_STOPM_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB_SCR &amp;amp;= ~(SCB_SCR_SLEEPDEEP_MASK | SCB_SCR_SLEEPONEXIT_MASK);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b- Here are the 2 functions I use to switch from HIRC to LIRC2M:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void set_HIRC(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_MC |= MCG_MC_HIRCEN_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C1 = MCG_C1_CLKS(0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C2 = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (((MCG_S &amp;amp; MCG_S_CLKST_MASK) &amp;gt;&amp;gt; MCG_S_CLKST_SHIFT) != 0x00);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void set_LIRC(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;MCG_MC = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C1 = MCG_C1_CLKS(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;MCG_C2 = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (((MCG_S &amp;amp; MCG_S_CLKST_MASK) &amp;gt;&amp;gt; MCG_S_CLKST_SHIFT) != 0x01);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c- At bootup I run this to enable HIRC and enable going into VLPS and VLLS modes: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_HIRC();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMC_PMPROT = (SMC_PMPROT_AVLP_MASK | SMC_PMPROT_AVLLS_MASK);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d- When the conditions to enter VLPS are met (KL03 is idle and has no pending tasks), I call the 2 functions like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_LIRC();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vlps_enter();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // KL03 is in VLPS here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vlps_exit();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_HIRC();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d- My KL03 is configured as an SPI slave (with SPISWAI bit set in SPI0_C2 register) and expect that the KL03 would exit VLPS whenever an SPI transfer is coming its way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;3. What I'm seeing:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;a- With the code I have above, I measured current consumption at 0.9mA which seems very high to me in VLPS and there's no peripherals running (no ADC, no LPUART... nothing)&lt;/P&gt;&lt;P&gt;b- Another problem is that with this code, the KL03 never properly wakes up and processes the SPI transfer it's receiving.&lt;/P&gt;&lt;P&gt;c- However, if I just remove the set_LIRC() call, power consumption goes to 1.8mA and the SPI transfer works great and I have no issues (other than the high power consumption)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;4. My questions:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;a- The power numbers I'm seeing are high, is there anything else I need to change to get very low numbers in the 100uA range?&lt;/P&gt;&lt;P&gt;b- Any thoughts on wether the switch to LIRC2M is actually needed?&lt;/P&gt;&lt;P&gt;c- Any idea why if I switch to LIRC2M, the SPI wakeup doesn't work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 17:41:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359370#M18143</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-03-27T17:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359371#M18144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Will,&lt;/P&gt;&lt;P&gt;The current consumption of the VLPS you measured is much higher than datasheet states.&lt;/P&gt;&lt;P&gt;So I think you need to check whether KL03 enter the VLPS mode correctly or not.&lt;/P&gt;&lt;P&gt;I'd like to suggest that you can refer to the low power demo that SDK develop kit provides and please download it through the link as below.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL03Z&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab&amp;amp;uc=true&amp;amp;lang_cd=en" title="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL03Z&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab&amp;amp;uc=true&amp;amp;lang_cd=en"&gt;FRDM-KL03Z|Freedom Development Board Platform|Freescale&lt;/A&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&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>Mon, 30 Mar 2015 08:21:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359371#M18144</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2015-03-30T08:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359372#M18145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI, I was doing some similar current checks on a LK27 (FRDM-KL27Z Freescale development board). BEWARE!!!&amp;nbsp; You need to do the current checks with out the debugger!!!&amp;nbsp; Here's my thread:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/message/495505"&gt;Re: VLPS mode started from debugger draws 2mAs . Even if debugger is turned off.&amp;nbsp; Even after hard reset. Only draws exepcted current (4.9uA) after a power cycle.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As to why the SPI isn't getting you out of VLPS, I thought you needed an interrupt to get out of VLPS.&amp;nbsp; I went down the path of setting bits in VNIC on the '27 for a timer to get out of VLPS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 14:52:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359372#M18145</guid>
      <dc:creator>rickstuart</dc:creator>
      <dc:date>2015-03-30T14:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359373#M18146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your response Jeremy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I am going into VLPS because if I remove the calls to vlps_enter() and vlps_exit(), the current consumption is at 6.6mA. With the calls, the current consumption is at 1.8mA. So I am able to go into a lower power state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took a look at the sample code in the SDK you suggested and replaced my code with it and I still see the same power numbers. So there must be something that is left on and consuming more power.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 21:10:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359373#M18146</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-03-30T21:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359374#M18147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply Rick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The numbers I quoted are withe debugger detached. Attaching the debugger adds about 0.5mA for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And my SPI interrupt is enabled. If I don't change from HIRC to LIRC2M, the SPI IRQ works fine. Only when I switch to the lower clock that the SPI doesn't wake up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 21:12:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359374#M18147</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-03-30T21:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359375#M18148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WRT the current.&amp;nbsp; So you managed to get the current down to where you expected it??&amp;nbsp; Note, pressing the red "X" on the debugger tool was not enough for me. Neither was pressing reset on the development board.&amp;nbsp;&amp;nbsp; I needed to cycle the power to the processor to get really low currents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure about the interrupt.&amp;nbsp; If the interrupt really works when you stay out of VLPS - I think it should work when you are in VLPS.&amp;nbsp; Check to make sure you clear the interrupt flag before getting out of the interrupt routine.&amp;nbsp; But you would have had to do that even if you never entered VLPS.&amp;nbsp; Humm.&amp;nbsp; Have to think about this one.&amp;nbsp; FYI, since I can't use the debugger to tell me where my code is&amp;nbsp; executing, I started using the LEDs on the Freescale development boards to indicate I was in main() or one of my interrupts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 22:35:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359375#M18148</guid>
      <dc:creator>rickstuart</dc:creator>
      <dc:date>2015-03-30T22:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359376#M18149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;No, I'm still having problems getting the current to the low level I expect it to be at.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I'm assuming that to get to the lowest possible power consumption I need to do the following: go into VLPS &lt;STRONG style="font-style: inherit; font-family: inherit; text-decoration: underline;"&gt;AND&lt;/STRONG&gt; switch from the HIRC 48MHz clock to the LIRC 2MHz clock.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;At the moment, I have 2 problems:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;1. &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt;When I try to do both of these things, my application doesn't work because of the SPI transfer not waking it up.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt;2. Going into VLPS and not changing the clock used is consuming 1.8mA now which is still high. If I change the clock, it drops even more to 0.9mA but I would expect it to be much lower.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The code I'm using is in my original post and it matches the SDK code that Jeremy pointed me too and other sample codes I found in the community.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Any help or guidance would be greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 23:34:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359376#M18149</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-03-30T23:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359377#M18150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have my code w/me right now so I'm guessing and will probably edit this post tomorrow if I find time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think you need to switch to the lower 8/2MHz clock just to get into Very Low Power Stop.&amp;nbsp;&amp;nbsp; If true, then it is very suspicious that when you are in VLPS, picking a different clock speed changes the processor's current demand. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; The code I'm using is in my original post and it matches the SDK code that&lt;/P&gt;&lt;P&gt;&amp;gt; Jeremy pointed me too and other sample codes I found in the community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I scanned your code again.&amp;nbsp; I don't see the SPI interrupt service routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, have you been able to break using the debugger inside your SPI interrupt service routine?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Only when I switch to the lower clock that the SPI doesn't wake up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You mean SPI doesn't work at alll?&amp;nbsp; Even w/o going into VLPS?&amp;nbsp; I missed this the 1st time.&amp;nbsp; You might check the clock block diagrams to see where the SPI is getting it's clock.&amp;nbsp; It might be that messing with the processor clock breaks the SPI feature.&amp;nbsp; That is, messing with the processor clock requires you to adjust the SPI clock settings so as not to break the SPI when selecting the 8/2MHz clock for the processor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit (added later):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked and it appears that I can run 48MHz, drop into VLPS w/no 8/2MHz clock running and get down to ~5uA.&amp;nbsp; If I leave the 2/8MHz clock running at 2MH to drive TPM0 I can only get down to ~20uA. But now I have a much more accurate clock to wake me up from VLPS mode.&amp;nbsp; If you can get SPI working at 48MHz I would try not to complicate things by switching to the 8/2MHz clock.&amp;nbsp; Or accidentally leave the 8/2MHz clock running while in VLPS mode.&amp;nbsp; Besides, you indicated that SPI only works at 48MHz and not when using the 8/2MHz clock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp; I would also disable any testing (unnecessary) output pins and mux settings that steer clocks to these output pins.&amp;nbsp; I find that driving pins with clocks takes way more current that I had expected.&amp;nbsp; These are things I did for testing.&amp;nbsp; I don't think the default (power up) state of the processor drives any pins with clocks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at your code:&lt;/P&gt;&lt;P&gt;You are doing this:&lt;/P&gt;&lt;P&gt;SMC_PMPROT = (SMC_PMPROT_AVLP_MASK | SMC_PMPROT_AVLLS_MASK);&lt;/P&gt;&lt;P&gt;I'm only doing this:&lt;/P&gt;&lt;P&gt;SMC_PMPROT=SMC_PMPROT_AVLP_MASK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure you need this function (i.e. not sure you need to do what is in this function):&lt;/P&gt;&lt;P&gt;vlps_exit()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may be missing either this:&lt;/P&gt;&lt;P&gt;SPI0_IRQHandler()&lt;/P&gt;&lt;P&gt;...or this:&lt;/P&gt;&lt;P&gt;SPI1_IRQHandler()&lt;/P&gt;&lt;P&gt;...I think it depends on how new the support code for you processor is.&amp;nbsp; These are the names given the SPI interrupt handler in the startup_MKL27Z644.s file for the '27 processor.&amp;nbsp; I assume Freescale uses the same name(s) (I don't know how many SPI ports an '03 has) for the '03.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 03:49:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359377#M18150</guid>
      <dc:creator>rickstuart</dc:creator>
      <dc:date>2015-03-31T03:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359378#M18151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Will,&lt;/P&gt;&lt;P&gt;I was wondering if you can share the whole demo, then I can run it with FRDM-KL03 board for checking.&lt;/P&gt;&lt;P&gt;I'm looking forward to your reply.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&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>Tue, 31 Mar 2015 06:41:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359378#M18151</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2015-03-31T06:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359379#M18152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Jeremy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the code I have. I trimmed down my project to this and I'm still seeing 0.9mA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void vlps_enter(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMC_PMCTRL = SMC_PMCTRL_STOPM(2));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dummyread = SMC_PMCTRL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)dummyread;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB_SCR |= SCB_SCR_SLEEPDEEP_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dsb();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wfi();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isb();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void vlps_exit(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMC_PMCTRL &amp;amp;= ~SMC_PMCTRL_STOPM_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB_SCR &amp;amp;= ~(SCB_SCR_SLEEPDEEP_MASK | SCB_SCR_SLEEPONEXIT_MASK);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void set_HIRC(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_MC |= MCG_MC_HIRCEN_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C1 = MCG_C1_CLKS(0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C2 = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (((MCG_S &amp;amp; MCG_S_CLKST_MASK) &amp;gt;&amp;gt; MCG_S_CLKST_SHIFT) != 0x00);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void set_LIRC(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_MC = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C1 = MCG_C1_CLKS(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C2 = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (((MCG_S &amp;amp; MCG_S_CLKST_MASK) &amp;gt;&amp;gt; MCG_S_CLKST_SHIFT) != 0x01);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void main()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* Set the KL03 clock to be the max at 48MHz */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;set_HIRC();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SMC_PMPROT = SMC_PMPROT_AVLP_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; while(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_LIRC();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vlps_enter();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // KL03 is in VLPS here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vlps_exit();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_HIRC();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I comment out the 2 calls to set_LIRC() and set_HIRC() inside of the while loop, I get a power consumption of 1.6mA.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 22:54:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359379#M18152</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-04-01T22:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359380#M18153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help Rick.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Here's the code I have and that I just replied to Jeremy with. I trimmed down my project to this and I'm still seeing 0.9mA. I'll deal with the SPI issue once I'm able to get to a low power number (I have a SPI IRQ handler SPI0_IRQHandler() but didn't mention it in my original post).&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;void vlps_enter(void)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;{&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMC_PMCTRL = SMC_PMCTRL_STOPM(2));&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dummyread = SMC_PMCTRL;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)dummyread;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB_SCR |= SCB_SCR_SLEEPDEEP_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dsb();&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wfi();&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isb();&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;void vlps_exit(void)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;{&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMC_PMCTRL &amp;amp;= ~SMC_PMCTRL_STOPM_MASK;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB_SCR &amp;amp;= ~(SCB_SCR_SLEEPDEEP_MASK | SCB_SCR_SLEEPONEXIT_MASK);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;void set_HIRC(void)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;{&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_MC |= MCG_MC_HIRCEN_MASK;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C1 = MCG_C1_CLKS(0);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C2 = 0;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (((MCG_S &amp;amp; MCG_S_CLKST_MASK) &amp;gt;&amp;gt; MCG_S_CLKST_SHIFT) != 0x00);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;void set_LIRC(void)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;{&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_MC = 0;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C1 = MCG_C1_CLKS(1);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C2 = 0;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (((MCG_S &amp;amp; MCG_S_CLKST_MASK) &amp;gt;&amp;gt; MCG_S_CLKST_SHIFT) != 0x01);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;}&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;void main()&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;{&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp; /* Set the KL03 clock to be the max at 48MHz */&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;set_HIRC();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp; SMC_PMPROT = SMC_PMPROT_AVLP_MASK;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp; while(1)&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_LIRC();&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vlps_enter();&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // KL03 is in VLPS here&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vlps_exit();&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set_HIRC();&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;}&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;If I comment out the 2 calls to set_LIRC() and set_HIRC() inside of the while loop, I get a power consumption of 1.6mA.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 22:56:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359380#M18153</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-04-01T22:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359381#M18154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Will X,&lt;/P&gt;&lt;P&gt;I'm working on this code now and I'll inform you ASAP if I work it out.&lt;/P&gt;&lt;P&gt;And you can also share some updating in the community.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&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, 02 Apr 2015 07:02:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359381#M18154</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2015-04-02T07:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359382#M18155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Btw, I just ran that snippet of code on a FRDM-KL03Z board measured the power consumed by the KL03 alone (through jumper J10) and I'm seeing the same numbers: 0.9mA when switching from HIRC to LIRC2M and 1.6mA if not touching the clocks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2015 18:40:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359382#M18155</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-04-02T18:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359383#M18156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeremy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Were you able to run my code on your end and measure the power consumption?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 20:32:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359383#M18156</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-04-06T20:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359384#M18157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Will,&lt;/P&gt;&lt;P&gt;I've got the different result from you, I used the code from the SDK instead of yours, then the current consumption will drop to 1.85uA when the MCU entered the VLPS mode.&lt;/P&gt;&lt;P&gt;I ran the code on the FRDM-KL03Z board.&lt;/P&gt;&lt;P&gt;Wish it helps.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&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>Tue, 07 Apr 2015 06:02:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359384#M18157</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2015-04-07T06:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359385#M18158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for letting me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you point me to exactly which sample code from the SDK you used? There's a ton of examples there so pointing me to the one you ran would be great.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:17:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359385#M18158</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-04-07T17:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359386#M18159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Will,&lt;/P&gt;&lt;P&gt;FSL's shared a Kinetis SDK_1.0.0 Standone for FRDM-KL03Z and it includes a low_power_rtc demo which illustrates the ways to enter and exit different low power modes.&lt;/P&gt;&lt;P&gt;This demo resides in ~\Freescale\KSDK_1.0.0-KL03Z\demos and you can download the SDK through the link as below.&lt;/P&gt;&lt;P&gt;&lt;A href="https://cache.freescale.com/secured/sdk/Freescale_KSDK_1.0.0-KL03Z.exe?__gda__=1428466397_9bc09e3adb75fdecb1bedf0dfc9a196d&amp;amp;fileExt=.exe" title="https://cache.freescale.com/secured/sdk/Freescale_KSDK_1.0.0-KL03Z.exe?__gda__=1428466397_9bc09e3adb75fdecb1bedf0dfc9a196d&amp;amp;fileExt=.exe"&gt;https://cache.freescale.com/secured/sdk/Freescale_KSDK_1.0.0-KL03Z.exe?__gda__=1428466397_9bc09e3adb75fdecb1bedf0dfc9a19…&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&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>Wed, 08 Apr 2015 02:15:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359386#M18159</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2015-04-08T02:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359387#M18160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jeremy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to look into that but that SDK is a total mess. And me development environment is on Mac so I'm having a lot of problems to figure out how to load it on the FRDM-KL03Z.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you able to load my code and run it yourself?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;void vlps_enter(void)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;{&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMC_PMCTRL = SMC_PMCTRL_STOPM(2));&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dummyread = SMC_PMCTRL;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)dummyread;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB_SCR |= SCB_SCR_SLEEPDEEP_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dsb();&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wfi();&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isb();&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;void vlps_exit(void)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;{&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMC_PMCTRL &amp;amp;= ~SMC_PMCTRL_STOPM_MASK;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB_SCR &amp;amp;= ~(SCB_SCR_SLEEPDEEP_MASK | SCB_SCR_SLEEPONEXIT_MASK);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;void set_HIRC(void)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;{&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_MC |= MCG_MC_HIRCEN_MASK;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C1 = MCG_C1_CLKS(0);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C2 = 0;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (((MCG_S &amp;amp; MCG_S_CLKST_MASK) &amp;gt;&amp;gt; MCG_S_CLKST_SHIFT) != 0x00);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;void set_LIRC(void)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;{&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_MC = 0;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C1 = MCG_C1_CLKS(1);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCG_C2 = 0;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (((MCG_S &amp;amp; MCG_S_CLKST_MASK) &amp;gt;&amp;gt; MCG_S_CLKST_SHIFT) != 0x01);&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;void main()&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;{&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; /* Set the KL03 clock to be the max at 48MHz */&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt;set_HIRC();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; SMC_PMPROT = SMC_PMPROT_AVLP_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; while(1)&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //set_LIRC();&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vlps_enter();&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // KL03 is in VLPS here&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vlps_exit();&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //set_HIRC();&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 23:47:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359387#M18160</guid>
      <dc:creator>willx</dc:creator>
      <dc:date>2015-04-08T23:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359388#M18161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Will,&lt;/P&gt;&lt;P&gt;Please use these simply codes as below to enter the VLPS mode and wish it helps.&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1428571107619567" jivemacro_uid="_1428571107619567" modifiedtitle="true"&gt;
&lt;P&gt;void Ready_vlpr(void)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM_CLKDIV1|=(SIM_CLKDIV1_OUTDIV4(3) | SIM_CLKDIV1_OUTDIV1(1));&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;int enter_vlpr(void)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; int i;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; unsigned int return_value = 0;&amp;nbsp; //default return value = indicates error&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if ((SMC_PMSTAT &amp;amp; SMC_PMSTAT_PMSTAT_MASK)== 4){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return_value = 0x14;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* The PMPROT register may have already been written by init code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If so then this next write is not done. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMPROT is write once after RESET &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this write-once bit allows the MCU to enter the&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; very low power modes: VLPR, VLPW, and VLPS&amp;nbsp; */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SMC_PMPROT = SMC_PMPROT_AVLP_MASK; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Set the (for MC1)LPLLSM or (for MC2)STOPM field&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; to 0b010 for VLPS mode -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and RUNM bits to 0b010 for VLPR mode&amp;nbsp; */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SMC_PMCTRL &amp;amp;= ~SMC_PMCTRL_RUNM_MASK;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SMC_PMCTRL&amp;nbsp; |= SMC_PMCTRL_RUNM(0x2);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Wait for VLPS regulator mode to be confirmed */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; for (i = 0 ; i &amp;lt; 10000 ; i++)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; /* check that the value of REGONS bit is not 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; once it is a zero we can stop checking */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((PMC_REGSC &amp;amp; PMC_REGSC_REGONS_MASK) ==0x04){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 0 Regulator is in stop regulation or in transition&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to/from it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 MCU is in Run regulation mode */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&amp;nbsp; break;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp; if ((PMC_REGSC &amp;amp; PMC_REGSC_REGONS_MASK) ==0x04)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return_value = 0x24;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* SMC_PMSTAT register only exist in Mode Controller 2 MCU versions */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if ((SMC_PMSTAT &amp;amp; SMC_PMSTAT_PMSTAT_MASK) == 4) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return_value = SMC_PMSTAT;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; return (return_value);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;void enter_vlps(void)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; volatile unsigned int dummyread;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* The PMPROT register may have already been written by init code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If so then this next write is not done since &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMPROT is write once after RESET&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; allows the MCU to enter the VLPR, VLPW, and VLPS modes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If AVLP is already writen to 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stop is entered instead of VLPS*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SMC_PMPROT = SMC_PMPROT_AVLP_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Set the STOPM field to 0b010 for VLPS mode */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SMC_PMCTRL &amp;amp;= ~SMC_PMCTRL_STOPM_MASK;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SMC_PMCTRL |=&amp;nbsp; SMC_PMCTRL_STOPM(0x2);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /*wait for write to complete to SMC before stopping core */ &lt;/P&gt;
&lt;P&gt;&amp;nbsp; dummyread = SMC_PMCTRL;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; dummyread++;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Now execute the stop instruction to go into VLPS */&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Set the SLEEPDEEP bit to enable deep sleep mode (STOP) */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SCB_SCR |= SCB_SCR_SLEEPDEEP_MASK;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; __wfi();&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;/*----------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp; MAIN function&lt;/P&gt;
&lt;P&gt;*----------------------------------------------------------------------------*/&lt;/P&gt;
&lt;P&gt;int main (void)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Ready_vlpr();//Busclk = 8Mhz/2 /2 /4= 500K&lt;/P&gt;
&lt;P&gt;&amp;nbsp; enter_vlpr();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; enter_vlps();&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&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, 09 Apr 2015 09:19:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359388#M18161</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2015-04-09T09:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problems putting KL03 into VLPS and reducing power consumption</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359389#M18162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ping,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can not get the FRDM-KL03Z to draw less than 250uA.&amp;nbsp; I used your software from above but had make 4 changes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) added #include "MKL03Z4.h"&amp;nbsp; &lt;/P&gt;&lt;P&gt;2) added #include "core_cm0plus.h"&lt;/P&gt;&lt;P&gt;3) removed KL03Z/lib/ksdk_platform_lib/iar/KL03Z4/debug/ksdk_platform_lib.a from library list.&lt;/P&gt;&lt;P&gt;4) changed "__wfi();" to "__asm("WFI");"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I programmed the LK03 processor, disconnected the debugger, then removed and restored power.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 16:48:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problems-putting-KL03-into-VLPS-and-reducing-power-consumption/m-p/359389#M18162</guid>
      <dc:creator>rickstuart</dc:creator>
      <dc:date>2015-04-09T16:48:40Z</dc:date>
    </item>
  </channel>
</rss>

