<?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: can not wakeup from stop in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/can-not-wakeup-from-stop/m-p/605759#M13121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; My program is a bit messy。The&amp;nbsp;process like this：&lt;/P&gt;&lt;P&gt;void wakeupinit(void)&lt;BR /&gt;{ DIENL_DIENL1=1;&amp;nbsp;&lt;BR /&gt; PIFL_PIFL1=1;//clear&lt;BR /&gt; PTPSL_PTPSL1=1; //&lt;BR /&gt; PTAENL_PTAENL1=0; &lt;BR /&gt; PIEL_PIEL1 =1;//enable&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;void main(void)&lt;/P&gt;&lt;P&gt;{ &amp;nbsp;PLL_init(); //32MHz&lt;BR /&gt; CAN_init(); &lt;BR /&gt; DIENL_DIENL1=1; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Enter stop &amp;nbsp;signal &amp;nbsp; detect&lt;BR /&gt; CPMUCLKS_PSTP=0;&lt;BR /&gt; asm ANDCC #0x7F; //stop&lt;BR /&gt; EnableInterrupts; &lt;BR /&gt; while(1)&lt;BR /&gt; { &amp;nbsp; &amp;nbsp;sencandata();&lt;BR /&gt;if(PTIL_PTIL1==0){&amp;nbsp;&lt;SPAN&gt;wakeupinit( ); &amp;nbsp;&lt;/SPAN&gt;asm STOP; &amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;if(PON&amp;gt;0) dealONON();&lt;BR /&gt; __RESET_WATCHDOG(); &amp;nbsp; &amp;nbsp;//watchdog&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;void dealONON(void)&lt;BR /&gt; { PON=0; &amp;nbsp; &amp;nbsp;&amp;nbsp;PIFL_PIFL1=1;//clear&amp;nbsp;&lt;BR /&gt; DIENL_DIENL1=1; //&lt;BR /&gt; PTAENL_PTAENL1=0; &lt;BR /&gt; PIEL_PIEL1 =0;//disable&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;interrupt &amp;nbsp; 79 &amp;nbsp; &amp;nbsp;void portl(void) &amp;nbsp;//wake up interrupt&amp;nbsp;&lt;BR /&gt;{ &amp;nbsp;PON=1; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;PIFL_PIFL1=1; &amp;nbsp;//clear&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;When in run model ,it can send CAN data.Sometimes it could not wakeup from stop model .could you help me watch &amp;nbsp;is there any problems in my process.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 20 Nov 2016 12:15:23 GMT</pubDate>
    <dc:creator>xiaohui200808</dc:creator>
    <dc:date>2016-11-20T12:15:23Z</dc:date>
    <item>
      <title>can not wakeup from stop</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/can-not-wakeup-from-stop/m-p/605757#M13119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Iam using S12ZVC64, &amp;nbsp;I use PORTL(HVI) as a signal to control MCU enter/wakeup from stop model. when the Port L1 is high MCU wakeup from stop .when &lt;SPAN&gt;Port L1 is low MCU enter stop . &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;my problem is I can enter stop model easily.But sometimes I couldnot wakeup from stop model when PORTLfrom LOW to HIGH.&lt;/P&gt;&lt;P&gt;Could you help me.&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-339187"&gt;not-wakeup.rar&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 11:23:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/can-not-wakeup-from-stop/m-p/605757#M13119</guid>
      <dc:creator>xiaohui200808</dc:creator>
      <dc:date>2016-11-18T11:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: can not wakeup from stop</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/can-not-wakeup-from-stop/m-p/605758#M13120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi xiaohui,&lt;/P&gt;&lt;P&gt;Could you please specify how you test whether MCU wake-up or not?&lt;/P&gt;&lt;P&gt;I shortly look at your code and I cannot see any wake-up signal (like GPIO pin toggling) in your main loop - all unconditioned commands do not contain and any commands for outside visible signal.&lt;/P&gt;&lt;P&gt;Maybe I just miss something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The typical way how we detect stop/run mode is power consumption measurement, but the run mode may be sometimes missed when wake-up execution time is enough short.&lt;/P&gt;&lt;P&gt;The next and more reliable way of stop/run mode detection is watching ECLK signal by an oscilloscope. In that case, we have to enable ECLK signal in normal mode by ECLKCTL_NECLK=0; command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: You use full stop mode and the first command after wake-up may be CAN_send() function. You don’t wait for the start of crystal/oscillator oscillation. So, there may be also a potential issue with CAN clock specification. I would like to recommend wait for UPOSC flag (until oscillator clock will be validated) first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Radek&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>Sat, 19 Nov 2016 20:15:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/can-not-wakeup-from-stop/m-p/605758#M13120</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-11-19T20:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: can not wakeup from stop</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/can-not-wakeup-from-stop/m-p/605759#M13121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; My program is a bit messy。The&amp;nbsp;process like this：&lt;/P&gt;&lt;P&gt;void wakeupinit(void)&lt;BR /&gt;{ DIENL_DIENL1=1;&amp;nbsp;&lt;BR /&gt; PIFL_PIFL1=1;//clear&lt;BR /&gt; PTPSL_PTPSL1=1; //&lt;BR /&gt; PTAENL_PTAENL1=0; &lt;BR /&gt; PIEL_PIEL1 =1;//enable&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;void main(void)&lt;/P&gt;&lt;P&gt;{ &amp;nbsp;PLL_init(); //32MHz&lt;BR /&gt; CAN_init(); &lt;BR /&gt; DIENL_DIENL1=1; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Enter stop &amp;nbsp;signal &amp;nbsp; detect&lt;BR /&gt; CPMUCLKS_PSTP=0;&lt;BR /&gt; asm ANDCC #0x7F; //stop&lt;BR /&gt; EnableInterrupts; &lt;BR /&gt; while(1)&lt;BR /&gt; { &amp;nbsp; &amp;nbsp;sencandata();&lt;BR /&gt;if(PTIL_PTIL1==0){&amp;nbsp;&lt;SPAN&gt;wakeupinit( ); &amp;nbsp;&lt;/SPAN&gt;asm STOP; &amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;if(PON&amp;gt;0) dealONON();&lt;BR /&gt; __RESET_WATCHDOG(); &amp;nbsp; &amp;nbsp;//watchdog&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;void dealONON(void)&lt;BR /&gt; { PON=0; &amp;nbsp; &amp;nbsp;&amp;nbsp;PIFL_PIFL1=1;//clear&amp;nbsp;&lt;BR /&gt; DIENL_DIENL1=1; //&lt;BR /&gt; PTAENL_PTAENL1=0; &lt;BR /&gt; PIEL_PIEL1 =0;//disable&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;interrupt &amp;nbsp; 79 &amp;nbsp; &amp;nbsp;void portl(void) &amp;nbsp;//wake up interrupt&amp;nbsp;&lt;BR /&gt;{ &amp;nbsp;PON=1; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;PIFL_PIFL1=1; &amp;nbsp;//clear&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;When in run model ,it can send CAN data.Sometimes it could not wakeup from stop model .could you help me watch &amp;nbsp;is there any problems in my process.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Nov 2016 12:15:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/can-not-wakeup-from-stop/m-p/605759#M13121</guid>
      <dc:creator>xiaohui200808</dc:creator>
      <dc:date>2016-11-20T12:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: can not wakeup from stop</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/can-not-wakeup-from-stop/m-p/605760#M13122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi xiaohui,&lt;/P&gt;&lt;P&gt;So, if I understood correctly, you detect wake-up event by watching CAN communication. Correct?&lt;/P&gt;&lt;P&gt;How you watch this communication? By oscilloscope or by CAN analyzer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sencandata() function (I guess that it is the same what send_chelun_data() function in your code) just fill CAN TX buffer.&lt;/P&gt;&lt;P&gt;So, it is possible that asm STOP instruction is executed prior or during sending CAN message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please implement code for switch CAN module into sleep mode prior you start execute asm STOP instruction.&lt;/P&gt;&lt;P&gt;See my comment here: &lt;A _jive_internal="true" href="https://community.nxp.com/thread/439160"&gt;https://community.nxp.com/thread/439160&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This should manage that CAN module will finish all TX messages prior entering into stop mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Radek&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, 21 Nov 2016 16:42:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/can-not-wakeup-from-stop/m-p/605760#M13122</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-11-21T16:42:18Z</dc:date>
    </item>
  </channel>
</rss>

