<?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: S12ZVL32 Autonomous Periodical Interrupt in STOP mode in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL32-Autonomous-Periodical-Interrupt-in-STOP-mode/m-p/986646#M16894</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/chaitanya.kalyani@seoyonelec-rnd.in"&gt;chaitanya.kalyani@seoyonelec-rnd.in&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;The API interrupt brings the MCU out of the Stop mode.&lt;/P&gt;&lt;P&gt;Once the ISR is finished, the execution continues with the next instruction after ASM STOP unless there is another interrupt pending.&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>Wed, 19 Feb 2020 15:16:31 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2020-02-19T15:16:31Z</dc:date>
    <item>
      <title>S12ZVL32 Autonomous Periodical Interrupt in STOP mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL32-Autonomous-Periodical-Interrupt-in-STOP-mode/m-p/986645#M16893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having an issue with&amp;nbsp;Autonomous Periodical Interrupt in Stop Mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to read ADC value in stop mode. So before going into stop mode starting&amp;nbsp;Autonomous Periodical Interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I am not sure that when interrupt comes it is executing only ISR or it is exiting from stop mode and executing main logic also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Implemented below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. At the time of initialization&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void func_api_init(void)&lt;BR /&gt;{&lt;BR /&gt; CPMUAPICTL = 0x80U;&amp;nbsp;&lt;BR /&gt; CPMUAPIR = 0x2EE0U;&amp;nbsp;&lt;BR /&gt; CPMUACLKTR = 0x00U;&amp;nbsp;&lt;BR /&gt; CPMUAPICTL = 0x83U;&amp;nbsp;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;2. Entering into stop mode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void GoToSleep(void)&lt;BR /&gt;{&lt;BR /&gt; DisableInterrupts;&lt;BR /&gt; SCI0ASR1_RXEDGIF = 1; // clear flag&lt;BR /&gt; SCI0ACR1_RXEDGIE = 1; // edge interrupt enabled for wake up&lt;BR /&gt; CPMUAPICTL_APIFE = 1; //Autonomous periodical interrupt is enabled and timer starts running.&lt;BR /&gt; EnableInterrupts;&lt;BR /&gt; __asm(STOP);&lt;BR /&gt; //After come out of stop mode disable interrupts&lt;BR /&gt; SCI0ACR1_RXEDGIE = 0;&lt;BR /&gt; SCI0ACR1_RXEDGIE = 0;&lt;BR /&gt; CPMUAPICTL_APIFE = 0; // 0 Autonomous periodical interrupt is disabled&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ISR&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#pragma CODE_SEG __NEAR_SEG NON_BANKED&lt;BR /&gt;ISR(API_IntISR)&lt;BR /&gt;{&lt;BR /&gt; CPMUAPICTL_APIF = 1; // Interrupt flag cleared by writing a 1.&lt;BR /&gt; API_Interrupt = TRUE;&lt;BR /&gt;}&lt;BR /&gt;#pragma CODE_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. When it exit from stop mode due tp API interrupt checking in main&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (TRUE == API_Interrupt)&lt;BR /&gt; {&lt;BR /&gt; API_Interrupt = FALSE; &lt;BR /&gt;ReadAnalog&lt;BR /&gt; if(TRUE == HW_Interrupt)&lt;BR /&gt; {&lt;BR /&gt; l_ifc_wake_up(LIN0); &lt;BR /&gt;State = Operating;&lt;BR /&gt; Sleep = FALSE;&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt;State = Standby;&lt;BR /&gt; Sleep = TRUE;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What exact action will happen when&amp;nbsp;Autonomous Periodical Interrupt come.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2020 02:24:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL32-Autonomous-Periodical-Interrupt-in-STOP-mode/m-p/986645#M16893</guid>
      <dc:creator>chaitanya_kalyani</dc:creator>
      <dc:date>2020-02-19T02:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: S12ZVL32 Autonomous Periodical Interrupt in STOP mode</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL32-Autonomous-Periodical-Interrupt-in-STOP-mode/m-p/986646#M16894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/chaitanya.kalyani@seoyonelec-rnd.in"&gt;chaitanya.kalyani@seoyonelec-rnd.in&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;The API interrupt brings the MCU out of the Stop mode.&lt;/P&gt;&lt;P&gt;Once the ISR is finished, the execution continues with the next instruction after ASM STOP unless there is another interrupt pending.&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>Wed, 19 Feb 2020 15:16:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVL32-Autonomous-Periodical-Interrupt-in-STOP-mode/m-p/986646#M16894</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2020-02-19T15:16:31Z</dc:date>
    </item>
  </channel>
</rss>

