<?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: Causing an S12 Reset in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154143#M4580</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;OK, finally getting around to testing this and am stumped at how to deliberately trip the CME to cause a reset.&lt;BR /&gt;&lt;BR /&gt;An S12NE64 with the following values:&lt;BR /&gt;&lt;BR /&gt;PLLCTL = 0xc0&lt;BR /&gt;CLKSEL = 0x80&lt;BR /&gt;CRGFLG = 0x9c&lt;BR /&gt;CRGINT = 0x80&lt;BR /&gt;&lt;BR /&gt;Interrupts are disabled with SEI.&lt;BR /&gt;&lt;BR /&gt;Doesn't seem to stop for an assembly STOP instruction, in fact it seems to run right through STOP.&lt;BR /&gt;&lt;BR /&gt;Read 4.3.2.7 where it says, "In Stop Mode (PSTP=0) the clock monitor is disabled independently of the CME bit setting and any loss of clock will not be detected." so I added PSTP to CLKSEL and no improvement.&lt;BR /&gt;&lt;BR /&gt;CLKSEL = CLKSEL_PLLSEL_MASK + CLKSEL_PSTP_MASK;&lt;BR /&gt;&lt;BR /&gt;Had the great idea that if I would CLKSEL_PLLSEL = 1 select the PLL as the clock then disable the PLL using PLLCTL_PLLON = 0, that it should reset for lack of a clock. Doesn't seem to be happening.&lt;BR /&gt;&lt;BR /&gt;Appears the clock logic was designed to be foolproof, preventing exactly what I'm trying to do. So in summary, "How can I invoke a Clock Monitor Reset?"&lt;BR /&gt;&lt;BR /&gt;The whole idea here is to make a RESET so that a previously disabled COP can be enabled. Otherwise I could just jump to _Startup().&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Jul 2008 02:18:09 GMT</pubDate>
    <dc:creator>dkelly</dc:creator>
    <dc:date>2008-07-04T02:18:09Z</dc:date>
    <item>
      <title>Causing an S12 Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154135#M4572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd like to make a Reset happen on the S12 at will using some instruction or sequence of instructions. Is that possible? Does anyone know how to do it? Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 02:58:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154135#M4572</guid>
      <dc:creator>Bee</dc:creator>
      <dc:date>2008-05-08T02:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Causing an S12 Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154136#M4573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;On S12, the best way to reset chip from software is to enable COP (if not already enabled) and write value other than 0x55 and 0xAA to ARMCOP register. Don't forget that COP config registers are write-once register so you should either keep COP always enabled and pet it periodically, or don't touch COP config until you want to reset. COP disable/enable won't work in normal modes.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;On S12X in normal single chip mode you also can use illegal address access reset. Just read unimplemented memory area.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 11:11:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154136#M4573</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2008-05-08T11:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Causing an S12 Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154137#M4574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Your S12X solution is what I was looking for: reading an unimplemented memory location. That's the simplest and most elegant without using COP.&lt;BR /&gt;Thank you.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2008 11:21:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154137#M4574</guid>
      <dc:creator>Bee</dc:creator>
      <dc:date>2008-05-08T11:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Causing an S12 Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154138#M4575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Have a very similar situation where I have inherited fielded S12NE64's with COP disabled. The "write once after reset" has been consumed. Can remotely update the firmware but have found no internal software means to RESET the CPU that new firmware can enable COP. Nobody thought to wire the RESET pin to an I/O port.&lt;BR /&gt;&lt;BR /&gt;Eventually a power failure will reset the unit, I'd rather not wait. Is there any other way?&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2008 22:02:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154138#M4575</guid>
      <dc:creator>dkelly</dc:creator>
      <dc:date>2008-05-14T22:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Causing an S12 Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154139#M4576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Look at the memory space that you have for your particular MCU. Find a memory location(s) that is not available (a page that does not exist). Try reading from that location. It should cause an illegal access which should go to a Reset condition. You'll have to experiment with it to be sure it resets. Once you have found that 'magic location', you can build code to Reset at will. I was able to do it a few times, so I'm confident it works, but I have not built up a routine which I can easily call (another 'fire' turned up to consume my time).&lt;BR /&gt;Good luck. And I expect to be on it in June sometime. We can coordinate again at that time.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 10:25:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154139#M4576</guid>
      <dc:creator>Bee</dc:creator>
      <dc:date>2008-05-15T10:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Causing an S12 Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154140#M4577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Bee, S12NE is S12, not S12X, and doesn't have illagal address access feature.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;dkelly,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;if you want COP to stay&amp;nbsp;off, then why aren't&amp;nbsp;you just leaving COPCTL untouched after reset? At the other hand&amp;nbsp;why not enable and use COP?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Yes, there's yet another way.&amp;nbsp;If you enable STOP, clock monitor (CME), and enter STOP mode with oscilator off, then CME will detect a loss of clock and reset your chip.&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by kef on &lt;SPAN class="date_text"&gt;2008-05-15&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:27 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2008 19:24:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154140#M4577</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2008-05-15T19:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Causing an S12 Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154141#M4578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;That sounds like another great idea. I'll use that myself in June. Thanks.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 00:25:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154141#M4578</guid>
      <dc:creator>Bee</dc:creator>
      <dc:date>2008-05-16T00:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Causing an S12 Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154142#M4579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;kef, thanks for the useful reply. Was exploring clock resets last week and an extra set of eyes confirming that route is very helpful.&lt;BR /&gt;&lt;BR /&gt;As I said originally, have inherited maintenance of several thousand fielded units. Possibly wasn't clear enough in stating the write-once-after-reset for COPCTL was used early in the startup process in the fielded code. Can update all the firmware in the unit remotely but am looking for a real RESET rather than a jump through the RESET vector. A real RESET that should let me enable COP.&lt;BR /&gt;&lt;BR /&gt;I agree completely, if one doesn't want COP then one should not touch COPCTL. But there are some who have a philosophy of explicitly writing all registers out of reset not trusting manufacturer's defaults. And sometimes that philosophy can put the MCU into usable state without a physical RESET.&lt;BR /&gt;&lt;BR /&gt;While writing a bad value to ARMCOP is an excellent way to RESET, the clock monitor reset is my compatible solution for exiting the old firmware, and should also work on the new. And in the scheme of things implementing both one right after the other doesn't cost anything.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 20:36:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154142#M4579</guid>
      <dc:creator>dkelly</dc:creator>
      <dc:date>2008-05-19T20:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Causing an S12 Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154143#M4580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;OK, finally getting around to testing this and am stumped at how to deliberately trip the CME to cause a reset.&lt;BR /&gt;&lt;BR /&gt;An S12NE64 with the following values:&lt;BR /&gt;&lt;BR /&gt;PLLCTL = 0xc0&lt;BR /&gt;CLKSEL = 0x80&lt;BR /&gt;CRGFLG = 0x9c&lt;BR /&gt;CRGINT = 0x80&lt;BR /&gt;&lt;BR /&gt;Interrupts are disabled with SEI.&lt;BR /&gt;&lt;BR /&gt;Doesn't seem to stop for an assembly STOP instruction, in fact it seems to run right through STOP.&lt;BR /&gt;&lt;BR /&gt;Read 4.3.2.7 where it says, "In Stop Mode (PSTP=0) the clock monitor is disabled independently of the CME bit setting and any loss of clock will not be detected." so I added PSTP to CLKSEL and no improvement.&lt;BR /&gt;&lt;BR /&gt;CLKSEL = CLKSEL_PLLSEL_MASK + CLKSEL_PSTP_MASK;&lt;BR /&gt;&lt;BR /&gt;Had the great idea that if I would CLKSEL_PLLSEL = 1 select the PLL as the clock then disable the PLL using PLLCTL_PLLON = 0, that it should reset for lack of a clock. Doesn't seem to be happening.&lt;BR /&gt;&lt;BR /&gt;Appears the clock logic was designed to be foolproof, preventing exactly what I'm trying to do. So in summary, "How can I invoke a Clock Monitor Reset?"&lt;BR /&gt;&lt;BR /&gt;The whole idea here is to make a RESET so that a previously disabled COP can be enabled. Otherwise I could just jump to _Startup().&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jul 2008 02:18:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Causing-an-S12-Reset/m-p/154143#M4580</guid>
      <dc:creator>dkelly</dc:creator>
      <dc:date>2008-07-04T02:18:09Z</dc:date>
    </item>
  </channel>
</rss>

