<?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: Using LPTMR to Wake Up from Stop/LLS</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-LPTMR-to-Wake-Up-from-Stop-LLS/m-p/296921#M12243</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved the problem.&amp;nbsp; I did not have system oscillator setting correct.&amp;nbsp; I attached the working PE settings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 May 2014 00:36:02 GMT</pubDate>
    <dc:creator>justinsayres</dc:creator>
    <dc:date>2014-05-15T00:36:02Z</dc:date>
    <item>
      <title>Using LPTMR to Wake Up from Stop/LLS</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-LPTMR-to-Wake-Up-from-Stop-LLS/m-p/296920#M12242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to using low power modes and I have spent a bit of time reading all the documentation and forum discussions without success. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want to use the LPTMR to trigger entering RUN mode.&amp;nbsp; It seems like the LPTMR interrupt flag is not triggering the LLWU to wakeup.&amp;nbsp; I added another wakeup source, external pushbutton, and that triggers the LLWU just fine.&amp;nbsp; So I'm not sure what I'm doing wrong with the LPTMR.&amp;nbsp; I do notice that most examples of using PE to generate the code use the TimerInt component along with a timer unit.&amp;nbsp; I tried to do that but when I enabled everything, I couldnt get access to certain commands such as RESET and UpdateTicks.&amp;nbsp; When I only use the Timer Unit LDD, it generates and interrupt so I don't really understand why&amp;nbsp; the interrupt component is even needed. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code for the interrupt handling:&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;void Cpu_OnLLSWakeUpINT(void) { &amp;nbsp; /* Write your code here ... */ &amp;nbsp; uint32_t tmp; &amp;nbsp;&amp;nbsp; &amp;nbsp; tmp = Cpu_GetLLSWakeUpFlags();&amp;nbsp; &amp;nbsp; if (tmp &amp;amp; LLWU_INT_MODULE0) /* LPTMR */ &amp;nbsp; {&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; LPTMR0_CSR |=&amp;nbsp; LPTMR_CSR_TCF_MASK;&amp;nbsp;&amp;nbsp; // write 1 to TCF to clear the LPT timer compare flag&amp;nbsp;&amp;nbsp; &amp;nbsp; } &amp;nbsp; else if( tmp &amp;amp; LLWU_INT_MODULE0) /* WakeUp Button - PTC6 */ &amp;nbsp; { &amp;nbsp; LLWU_PE3 |= LLWU_PE3_WUPE10_MASK; &amp;nbsp; } &amp;nbsp; HEARTBEAT_LED_SetVal(HEARTBEAT_LED_DeviceData); }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void mSecTimer_OnCounterRestart(LDD_TUserData *UserDataPtr) { &amp;nbsp; /* Write your code here ... */ &amp;nbsp; if(sensorMode == STANDBY) // if the sample interval just elapsed and we need to start a new sample &amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp; totalSampleTime += samplingInterval; // update totalSampleTime &amp;nbsp;&amp;nbsp;&amp;nbsp; startNewSample = TRUE; //&amp;nbsp; Set Flag &amp;nbsp; } &amp;nbsp; else &amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp; if(measurementStatus != COMPLETE) //&amp;nbsp; if we are in the middle of a measurement &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; totalSampleTime += measurementTime; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; measSpecPressDone = !measSpecPressDone; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; measurementStatus = COMPLETE; &amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp; } }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is where I call the PE CPU_SetOperationMode:&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;&amp;nbsp; if (LP_mode==LP_WAIT)&amp;nbsp; &amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cpu_SetOperationMode(DOM_WAIT, NULL, NULL); /* next interrupt will wake us up */ &amp;nbsp; } else if (LP_mode==LP_SLEEP)&amp;nbsp; &amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cpu_SetOperationMode(DOM_SLEEP, NULL, NULL); /* next interrupt will wake us up */ &amp;nbsp; } else if (LP_mode==LP_STOP)&amp;nbsp; &amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cpu_SetOperationMode(DOM_STOP, NULL, NULL); /* next interrupt will wake us up */ &amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is basically &lt;SPAN style="color: #373737; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px;"&gt;Erich Styger&lt;/SPAN&gt;'s code that I got from his mcuoneclipse website.&amp;nbsp; Like I said the only real difference I can see is my PE setup.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; If anyone can shed some light I would really appreciate it.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337334" rel="nofollow noopener noreferrer" target="_blank"&gt;My_PE_Setup.pef.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2014 23:26:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-LPTMR-to-Wake-Up-from-Stop-LLS/m-p/296920#M12242</guid>
      <dc:creator>justinsayres</dc:creator>
      <dc:date>2014-05-13T23:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using LPTMR to Wake Up from Stop/LLS</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-LPTMR-to-Wake-Up-from-Stop-LLS/m-p/296921#M12243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved the problem.&amp;nbsp; I did not have system oscillator setting correct.&amp;nbsp; I attached the working PE settings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 00:36:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Using-LPTMR-to-Wake-Up-from-Stop-LLS/m-p/296921#M12243</guid>
      <dc:creator>justinsayres</dc:creator>
      <dc:date>2014-05-15T00:36:02Z</dc:date>
    </item>
  </channel>
</rss>

