<?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>S12 / MagniV MicrocontrollersのトピックLow Power Mode Steps</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Low-Power-Mode-Steps/m-p/233580#M9428</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 have been trying to get the device I am currently working with into Full Stop Mode, however a few moments after it executes the instruction to go into Stop Mode, the MCU resets. AN2461 doesn't quite give an example of how to do this or the steps to follow. For example do I need to disable the watchdog, then Clear the S bit and finally execute the Stop command?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently my initialisation code for the RTI (use this in my application) and COP are:&lt;/P&gt;&lt;P&gt;CPMURTI = 0b11111111;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Divide clock bt 3.2x10^6&lt;/P&gt;&lt;P&gt;CPMUPROT = 0x26;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Disable write protection to CPMUCLKS register&lt;/P&gt;&lt;P&gt;CPMUCLKS |= 0b10000011;&amp;nbsp; //PLL Clk source, Disable Osc in stop mode, COP clk source is OSCCLK&lt;/P&gt;&lt;P&gt;CPMUPROT = 1;&lt;/P&gt;&lt;P&gt;CPMUINT_RTIE = 1;&amp;nbsp;&amp;nbsp; //Real Time Int Enable&lt;/P&gt;&lt;P&gt;_ENABLE_COP(5); &lt;/P&gt;&lt;P&gt;CPMUCOP_RSBCK = 1; //Don't reset while debugging&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the instructions I execute when I stop &lt;/P&gt;&lt;P&gt;_asm nop&lt;/P&gt;&lt;P&gt;_asm nop&lt;/P&gt;&lt;P&gt;_asm nop&lt;/P&gt;&lt;P&gt;_asm ANDCC #$7F;&lt;/P&gt;&lt;P&gt;_asm nop&lt;/P&gt;&lt;P&gt;_asm nop&lt;/P&gt;&lt;P&gt;_asm STOP&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing, don't understand why I get reset after the Stop is executed?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MCU used, MC9S12G96, Codewarrior IDE, Code is running without debugger connected &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jan 2014 12:13:11 GMT</pubDate>
    <dc:creator>vengeful</dc:creator>
    <dc:date>2014-01-14T12:13:11Z</dc:date>
    <item>
      <title>Low Power Mode Steps</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Low-Power-Mode-Steps/m-p/233580#M9428</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 have been trying to get the device I am currently working with into Full Stop Mode, however a few moments after it executes the instruction to go into Stop Mode, the MCU resets. AN2461 doesn't quite give an example of how to do this or the steps to follow. For example do I need to disable the watchdog, then Clear the S bit and finally execute the Stop command?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently my initialisation code for the RTI (use this in my application) and COP are:&lt;/P&gt;&lt;P&gt;CPMURTI = 0b11111111;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Divide clock bt 3.2x10^6&lt;/P&gt;&lt;P&gt;CPMUPROT = 0x26;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Disable write protection to CPMUCLKS register&lt;/P&gt;&lt;P&gt;CPMUCLKS |= 0b10000011;&amp;nbsp; //PLL Clk source, Disable Osc in stop mode, COP clk source is OSCCLK&lt;/P&gt;&lt;P&gt;CPMUPROT = 1;&lt;/P&gt;&lt;P&gt;CPMUINT_RTIE = 1;&amp;nbsp;&amp;nbsp; //Real Time Int Enable&lt;/P&gt;&lt;P&gt;_ENABLE_COP(5); &lt;/P&gt;&lt;P&gt;CPMUCOP_RSBCK = 1; //Don't reset while debugging&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the instructions I execute when I stop &lt;/P&gt;&lt;P&gt;_asm nop&lt;/P&gt;&lt;P&gt;_asm nop&lt;/P&gt;&lt;P&gt;_asm nop&lt;/P&gt;&lt;P&gt;_asm ANDCC #$7F;&lt;/P&gt;&lt;P&gt;_asm nop&lt;/P&gt;&lt;P&gt;_asm nop&lt;/P&gt;&lt;P&gt;_asm STOP&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing, don't understand why I get reset after the Stop is executed?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MCU used, MC9S12G96, Codewarrior IDE, Code is running without debugger connected &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2014 12:13:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Low-Power-Mode-Steps/m-p/233580#M9428</guid>
      <dc:creator>vengeful</dc:creator>
      <dc:date>2014-01-14T12:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Low Power Mode Steps</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Low-Power-Mode-Steps/m-p/233581#M9429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is an application note with the SW package which contains the 'Low Power Modes' code example. Find it using the link below. These examples were tested on Tower boards TWR-S12G128 and TWR-S12G240. The source code can be used for other S12G derivatives too.&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4455.pdf" title="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4455.pdf"&gt;http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4455.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4455SW.zip" title="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4455SW.zip"&gt;http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4455SW.zip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, the cause of the reset is the COP watchdog since you enabled it. There is a counter when timed-out generates a reset. Why do you need the COP enabled anyway? Leave it disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, there is a code line to prevent watchdog from generating reset:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;for (;;) { _FEED_COP(); } &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Usually this goes at the end of the main code.&lt;/P&gt;&lt;P&gt;Moreover, you should make sure that you never leave the main. It can be done by adding above mentioned code line or for example you can put any other 'for' loop (see example codes).&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jan 2014 09:52:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Low-Power-Mode-Steps/m-p/233581#M9429</guid>
      <dc:creator>iggi</dc:creator>
      <dc:date>2014-01-15T09:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Low Power Mode Steps</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Low-Power-Mode-Steps/m-p/233582#M9430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just few additional information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code line&amp;nbsp; CPMUCLKS |= 0b10000011; is doing logic OR function.&lt;/P&gt;&lt;P&gt;So, if COPOSCSEL1 bit is logic 1, the instruction above will not clear the bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that this cannot be debug in Special Mode (when BDM is connected) while MCU goes into Stop mode. BDM communication will fail and it is possible that BDM interface will automatically reset MCU. Therefore, test it in Normal Mode (BDM unconnected) and for detection use the ECLK pin where bus clock signal can be routed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 12:32:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Low-Power-Mode-Steps/m-p/233582#M9430</guid>
      <dc:creator>iggi</dc:creator>
      <dc:date>2014-01-23T12:32:42Z</dc:date>
    </item>
  </channel>
</rss>

