<?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: LPC11u68 - Can't Sleep after DeepSleep in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u68-Can-t-Sleep-after-DeepSleep/m-p/1362895#M46897</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Recommend confirm the demo with RTC wakeup can work well as your requirement , then change it to&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;TIMER32_0.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Oct 2021 03:40:44 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2021-10-28T03:40:44Z</dc:date>
    <item>
      <title>LPC11u68 - Can't Sleep after DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u68-Can-t-Sleep-after-DeepSleep/m-p/1361031#M46882</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Normal Sleep after DeepSleep also causes the LPC11u68 to go into DeepSleep.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I invoke the following to initiate DeepSleep:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;SCB&lt;/SPAN&gt;-&amp;gt;&lt;SPAN&gt;SCR &lt;/SPAN&gt;|= &lt;SPAN&gt;SCB_SCR_SLEEPDEEP_Msk&lt;/SPAN&gt;&lt;SPAN&gt;; // Set the DeepSleep-Bit&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;LPC_PMU&lt;/SPAN&gt;-&amp;gt;&lt;SPAN&gt;PCON &lt;/SPAN&gt;= &lt;SPAN&gt;PMU_PCON_PM_DEEPSLEEP&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;__WFI&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I wake up from it with the RTC Alarm Interrupt.&lt;/P&gt;&lt;P&gt;Then I call the following to go into normal Sleep:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;// Unset the SLEEPDEEP Bit and enable all Interrupts to cause a Wakeup&lt;BR /&gt;SCB&lt;/SPAN&gt;-&amp;gt;&lt;SPAN&gt;SCR &lt;/SPAN&gt;= &lt;SPAN&gt;SCB_SCR_SEVONPEND_Msk&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;LPC_PMU&lt;/SPAN&gt;-&amp;gt;&lt;SPAN&gt;PCON &lt;/SPAN&gt;= &lt;SPAN&gt;PMU_PCON_PM_SLEEP &lt;/SPAN&gt;| &lt;SPAN&gt;PMU_PCON_SLEEPFLAG &lt;/SPAN&gt;| &lt;SPAN&gt;PMU_PCON_NODPD&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;__WFI&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;From that, I want to wakeup with &lt;SPAN&gt;LPC_TIMER32_0&lt;/SPAN&gt;, but the Interrupt doesn't happen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have replaced the sleep with a busy-loop and the Interrupt happened.&lt;/P&gt;&lt;P&gt;I have also tested the normal Sleep code before a DeepSleep and everything works as expected.&lt;/P&gt;&lt;P&gt;(See Section 5.2.1.1 in the LPC11u68 User Manual, Page 64)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for taking your time to look at this&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;</description>
      <pubDate>Sun, 07 Nov 2021 02:05:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u68-Can-t-Sleep-after-DeepSleep/m-p/1361031#M46882</guid>
      <dc:creator>AnyTimeTraveler</dc:creator>
      <dc:date>2021-11-07T02:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11u68 - Can't Sleep after DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u68-Can-t-Sleep-after-DeepSleep/m-p/1361402#M46886</link>
      <description>&lt;P&gt;Hello &lt;SPAN class="UserName lia-user-name lia-user-rank-Fresh-Out-Contributor lia-component-message-view-widget-author-username"&gt;&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" style="color: #333f48;" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/192791" target="_self" aria-label="View Profile of AnyTimeTraveler"&gt;&lt;SPAN class=""&gt;AnyTimeTraveler,&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Fresh-Out-Contributor lia-component-message-view-widget-author-username"&gt;&lt;SPAN class=""&gt;How about first test and refer to the PMU demo under lpcopen?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Fresh-Out-Contributor lia-component-message-view-widget-author-username"&gt;&lt;SPAN class=""&gt;BR&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Fresh-Out-Contributor lia-component-message-view-widget-author-username"&gt;&lt;SPAN class=""&gt;Alice&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 07:17:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u68-Can-t-Sleep-after-DeepSleep/m-p/1361402#M46886</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2021-10-26T07:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11u68 - Can't Sleep after DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u68-Can-t-Sleep-after-DeepSleep/m-p/1362617#M46894</link>
      <description>&lt;P&gt;I just did.&lt;/P&gt;&lt;P&gt;This example uses the RTC instead of TIMER32_0 to wake from the sleep states.&lt;/P&gt;&lt;P&gt;So I added the initialisation for the timer like this:&lt;/P&gt;&lt;PRE&gt;Chip_TIMER_Init(&lt;SPAN&gt;LPC_TIMER32_0&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;uint32_t &lt;/SPAN&gt;&lt;SPAN&gt;timerFreq &lt;/SPAN&gt;= Chip_Clock_GetSystemClockRate()&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;Chip_TIMER_Reset(&lt;SPAN&gt;LPC_TIMER32_0&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;Chip_TIMER_PrescaleSet(&lt;SPAN&gt;LPC_TIMER32_0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;timerFreq &lt;/SPAN&gt;/ &lt;SPAN&gt;10&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;Chip_TIMER_SetMatch(&lt;SPAN&gt;LPC_TIMER32_0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;450&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;Chip_TIMER_MatchEnableInt(&lt;SPAN&gt;LPC_TIMER32_0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;Chip_TIMER_Enable(&lt;SPAN&gt;LPC_TIMER32_0&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;NVIC_ClearPendingIRQ(&lt;SPAN&gt;TIMER_32_0_IRQn&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;NVIC_EnableIRQ(&lt;SPAN&gt;TIMER_32_0_IRQn&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;And altered the code to skip the DeepPowerDown, so that the chip won't get reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When Chip_PMU_SleepState was called the second time, a match-interrupt from the timer should have woken it up.&lt;/P&gt;&lt;P&gt;Instead, the timer did not continue ticking during sleep (which is should have done and did during the first sleep).&lt;/P&gt;&lt;P&gt;I printed the timer values out before and after each sleep.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See this gist for the code and the log from the MCU:&lt;/P&gt;&lt;P&gt;&lt;A href="https://gist.github.com/AnyTimeTraveler/b1d98047a093a75329153b23939cbfc2" target="_blank" rel="noopener"&gt;https://gist.github.com/AnyTimeTraveler/b1d98047a093a75329153b23939cbfc2&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 17:44:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u68-Can-t-Sleep-after-DeepSleep/m-p/1362617#M46894</guid>
      <dc:creator>AnyTimeTraveler</dc:creator>
      <dc:date>2021-10-27T17:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11u68 - Can't Sleep after DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u68-Can-t-Sleep-after-DeepSleep/m-p/1362895#M46897</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Recommend confirm the demo with RTC wakeup can work well as your requirement , then change it to&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;TIMER32_0.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 03:40:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u68-Can-t-Sleep-after-DeepSleep/m-p/1362895#M46897</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2021-10-28T03:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: LPC11u68 - Can't Sleep after DeepSleep</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u68-Can-t-Sleep-after-DeepSleep/m-p/1367546#M46935</link>
      <description>&lt;P&gt;The demo works for me, even after changing it to use the timer.&lt;/P&gt;&lt;P&gt;I don't see a difference between my code and the demo, but there must be one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for pointing me in this direction.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Nov 2021 02:04:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC11u68-Can-t-Sleep-after-DeepSleep/m-p/1367546#M46935</guid>
      <dc:creator>AnyTimeTraveler</dc:creator>
      <dc:date>2021-11-07T02:04:05Z</dc:date>
    </item>
  </channel>
</rss>

