<?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: S12ZVL Lin Wake up from stop mode in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL-Lin-Wake-up-from-stop-mode/m-p/779774#M15513</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;BR /&gt;I followed your recommendations and removed the Standby mode from SCI module, also It looks like the interruption flag was not cleared by the command, thus it did not leave the ISR:&amp;nbsp;&lt;BR /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;SCI0ASR1_RXEDGIF = 0x01; /* Clear flag */&lt;SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;had to change to:&lt;BR /&gt;SCI0ACR1 = 0x00;&lt;BR /&gt;&lt;BR /&gt;The following configuration worked for me:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/**********************************************************************************************************************/&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Lin Init:&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;void Init_Lin(void)&lt;BR /&gt;{&lt;BR /&gt; LP0CR = 0X0B;&lt;BR /&gt; LP0SLRM = 0x01;&lt;BR /&gt;}&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/**********************************************************************************************************************/&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;Low Power routine:&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;DisableInterrupts;&lt;BR /&gt; __asm (ANDCC #0x7F); /* Enable Stop mode*/&lt;BR /&gt; LP0CR_LPWUE = 1;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* Lin-Phy Enable*/&lt;BR /&gt; Shutdown_Lights();&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* Power off the hardware*/&lt;BR /&gt; SCI0SR2_AMAP = 1;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;/* Make SCIAxxx registers accessible */&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt; SCI0ASR1_RXEDGIF = 1; /* clear flag*/&lt;BR /&gt; SCI0ACR1_RXEDGIE = 1; /* edge interrupt enabled for wake up*/&lt;BR /&gt; EnableInterrupts;&lt;BR /&gt; __asm(STOP);&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;/**********************************************************************************************************************/&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;SCI0_ISR:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt; SCI0SR2_AMAP = 1;&lt;BR /&gt; SCI0ACR1 = 0x00;//SCI0ACR1_RXEDGIE_MASK;&lt;BR /&gt; lin_lld_sci_isr();&lt;BR /&gt;&lt;BR /&gt;Find attached a working example of a demo using the Lin Wake up to restore the system from Stop mode.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Alexis&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2018 17:35:05 GMT</pubDate>
    <dc:creator>alexishernandez</dc:creator>
    <dc:date>2018-06-14T17:35:05Z</dc:date>
    <item>
      <title>S12ZVL Lin Wake up from stop mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL-Lin-Wake-up-from-stop-mode/m-p/779772#M15511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi community,&lt;BR /&gt;I've been trying to wake up the S12ZVL64 through LIN interface with really odd behaviours.&lt;BR /&gt;The module is able to wake up by the API and then it can return to stop mode without problems (because of this the logic of the non-Lin related code should be correct).&lt;BR /&gt;At this moment I don't have the API wake up (removed it to isolate the Lin issue), sometimes the microcontroller looks like being stucked into the SCI0 ISR (never returning to the main routine where the Stop mode was called), and some other times it looks like the system indeed returns to the main but do not answer to any Lin command.&lt;BR /&gt;I have the following questions related to the matter:&lt;BR /&gt;1.- When the system wake up from Stop mode, what is the status of the system ?&amp;nbsp;&lt;SPAN&gt;(Some internal module needs to be re-initialized to work as before the Stop command)?&lt;/SPAN&gt;&lt;BR /&gt;2.- Is there any special consideration for the LIN interface when the SCIACR1_RXEDGIE is set?&lt;BR /&gt;3.- Does the microcontroller needs any special command or is it enough with the toggle of the break in the signal?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I let you a snippet of the code:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/**********************************************************************************************************************/&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Lin Init:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; LP0CR_LPE = 1; // Enable LIN Phy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; LP0CR_LPPUE = 1; // Pull up to strong signal&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; LP0CR_LPWUE = 1; // Enable Lin-Phy wakeup&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; LP0SLRM = 0x01;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/**********************************************************************************************************************/&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Low Power routine:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;SCI0CR1_WAKE = 1; /* Wake up SCI at an idle condition on the RXD pin */ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; SCI0SR2_AMAP = 1; /* Make SCIAxxx registers accessible */ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; SCI0ACR1_RXEDGIE = 1; /* Edge interrupt enabled for wake up */ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; SCI0ASR1_RXEDGIF = 1; /* Clear flag */ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; SCI0SR2_AMAP = 0; /* Make SCIAxxx registers inaccessible */ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; SCI0CR2_RWU = 0x01; /* SCI enters into standby state */ &lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; asm (ANDCC #0x7F); /* Enable Stop mode */ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; __asm (STOP); /* Enter Stop mode */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/**********************************************************************************************************************/ &lt;BR /&gt;SCI0_ISR:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;ISR(VectorNumber_Vsci0, SCI0_INT) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; { &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; SCI0SR2_AMAP = 1; /* Make SCIAxxx registers accessible */ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; SCI0ACR1_RXEDGIE = 0x00; /* Edge interrupt disabled for wake up */ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; SCI0ASR1_RXEDGIF = 0x01; /* Clear flag */ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; //SCI0SR2_AMAP = 0; /* Make SCIAxxx registers inaccessible */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;lin_lld_sci_isr(); /* Lin Driver routine*/ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Best regards,&lt;BR /&gt;Alexis&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 15:12:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL-Lin-Wake-up-from-stop-mode/m-p/779772#M15511</guid>
      <dc:creator>alexishernandez</dc:creator>
      <dc:date>2018-06-13T15:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: S12ZVL Lin Wake up from stop mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL-Lin-Wake-up-from-stop-mode/m-p/779773#M15512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexis,&lt;BR /&gt;Could you attach the debugger to the MCU? It would be good to see where it is stucked.&lt;BR /&gt;What is the lin_lld_sci_isr() function?&lt;BR /&gt;There is no need to put the SCI module in the Standby mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A1. Please wait until PLL is locked.&lt;BR /&gt;A2. No&lt;BR /&gt;A3. If the LIN Physical Layer receives a dominant level longer than tWUFR followed by a rising edge, it sends a pulse to the SCI which can generate a wake-up interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 10:59:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL-Lin-Wake-up-from-stop-mode/m-p/779773#M15512</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2018-06-14T10:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: S12ZVL Lin Wake up from stop mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL-Lin-Wake-up-from-stop-mode/m-p/779774#M15513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;BR /&gt;I followed your recommendations and removed the Standby mode from SCI module, also It looks like the interruption flag was not cleared by the command, thus it did not leave the ISR:&amp;nbsp;&lt;BR /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;SCI0ASR1_RXEDGIF = 0x01; /* Clear flag */&lt;SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;had to change to:&lt;BR /&gt;SCI0ACR1 = 0x00;&lt;BR /&gt;&lt;BR /&gt;The following configuration worked for me:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/**********************************************************************************************************************/&lt;/SPAN&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Lin Init:&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;void Init_Lin(void)&lt;BR /&gt;{&lt;BR /&gt; LP0CR = 0X0B;&lt;BR /&gt; LP0SLRM = 0x01;&lt;BR /&gt;}&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;/**********************************************************************************************************************/&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;Low Power routine:&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;DisableInterrupts;&lt;BR /&gt; __asm (ANDCC #0x7F); /* Enable Stop mode*/&lt;BR /&gt; LP0CR_LPWUE = 1;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* Lin-Phy Enable*/&lt;BR /&gt; Shutdown_Lights();&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* Power off the hardware*/&lt;BR /&gt; SCI0SR2_AMAP = 1;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;/* Make SCIAxxx registers accessible */&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt; SCI0ASR1_RXEDGIF = 1; /* clear flag*/&lt;BR /&gt; SCI0ACR1_RXEDGIE = 1; /* edge interrupt enabled for wake up*/&lt;BR /&gt; EnableInterrupts;&lt;BR /&gt; __asm(STOP);&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;/**********************************************************************************************************************/&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff;"&gt;SCI0_ISR:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt; SCI0SR2_AMAP = 1;&lt;BR /&gt; SCI0ACR1 = 0x00;//SCI0ACR1_RXEDGIE_MASK;&lt;BR /&gt; lin_lld_sci_isr();&lt;BR /&gt;&lt;BR /&gt;Find attached a working example of a demo using the Lin Wake up to restore the system from Stop mode.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Alexis&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 17:35:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL-Lin-Wake-up-from-stop-mode/m-p/779774#M15513</guid>
      <dc:creator>alexishernandez</dc:creator>
      <dc:date>2018-06-14T17:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: S12ZVL Lin Wake up from stop mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL-Lin-Wake-up-from-stop-mode/m-p/779775#M15514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexis,&lt;/P&gt;&lt;P&gt;So you don't clear that flag at all now?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can stop the code in the ISR.&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;void SCI_RX_ISR(){

unsigned int i = 1;
 while(i);‍‍

...
}‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Attach the debugger,&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;IMG alt="pastedImage_5.png" src="https://community.nxp.com/t5/image/serverpage/image-id/61607iFC439AD0323BD479/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_5.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;clear the 'i' variable to 0 in the Variable view,&lt;/P&gt;&lt;P&gt;step the code and check all the flags.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:08:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL-Lin-Wake-up-from-stop-mode/m-p/779775#M15514</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2020-11-02T14:08:14Z</dc:date>
    </item>
  </channel>
</rss>

