<?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: Resetting HCS12 using software in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Resetting-HCS12-using-software/m-p/125077#M244</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was sawing some tips in the forum about the watchdog timer and I have some questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;actually&lt;BR /&gt;I'm working with the HCS12 microcontroller and I need to use the&lt;BR /&gt;watchdog timer in order to do&amp;nbsp; reset. I've configurated the COPCTL&lt;BR /&gt;register with 71 &lt;FONT color="#ff0000"&gt;(COPCTL=71)&lt;/FONT&gt; the program&lt;BR /&gt;stay in a infinite for loop showing a caracter ascii in the&lt;BR /&gt;hyperterminal until the watchdog finish. The problem is:&amp;nbsp; after the&lt;BR /&gt;watchdog timer has finished the program doesn't reset o may be yes, but&lt;BR /&gt;I can't see more caracters in the hyperterminal until I do a manual&lt;BR /&gt;reset.&amp;nbsp; I've attached the program. I hope that you can help me. many&lt;BR /&gt;thanks.&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
This is the main function:



 void main(void) {
  /* put your own code here */

  char msn[20]={"Hola"};
  char msn1[5]={"."}; 
  word cont1X;
  word cont2X;

  cont2X=0;
  while(cont2X&amp;lt;=5000)
  {
    cont2X++;
    cont1X=0;
    while(cont1X&amp;lt;=100)
    {
      asm BRN *;
      cont1X++;    
    }    
  }

  SCI0BD = 12;

  SCI0CR1 = 0x00;

  SCI0CR2 = 0x04;

  vfnSCITxMsg(msn);
  COPCTL=71;
  
  for(;;) {
  cont2X=0;
  while(cont2X&amp;lt;=5000)
  {
    cont2X++;
    cont1X=0;
    while(cont1X&amp;lt;=100)
    {
      asm BRN *;
      cont1X++;    
    }    
  }
  vfnSCITxMsg(msn1);
  } /* loop forever */
  /* please make sure that you never leave main */
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Aug 2009 21:50:58 GMT</pubDate>
    <dc:creator>wilero17</dc:creator>
    <dc:date>2009-08-25T21:50:58Z</dc:date>
    <item>
      <title>Resetting HCS12 using software</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Resetting-HCS12-using-software/m-p/125076#M243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Tue Sep 20, 2005 5:40 pm&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;Is it possible, to cause the HCS122 to reset itself using softare.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Wed Sep 21, 2005 8:09 pm&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;yes surely&lt;BR /&gt;&lt;BR /&gt; just activate the cop, register COPCTL&lt;BR /&gt; and trigger directly with a false value written to the ARMCOP register.&lt;BR /&gt;&lt;BR /&gt; Normally you would write 0x55 and then 0xAA; try some other value and you will get a reset at once&lt;BR /&gt;&lt;BR /&gt; e.g.&lt;BR /&gt; COPCTL = 0x01; // cop activated with shortest timeout&lt;BR /&gt; ARMCOP = 0x47; // her we will get kicked by the dog&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Thu Sep 22, 2005 4:55 pm&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;&lt;SPAN class="postdetails"&gt;&amp;nbsp;am assuming that Quantum needs to "simulate" a Power-On reset.&lt;BR /&gt; If you make sure that the COP reset vector is the same as the Power-On reset vector, Cristian's method should work perfectly.&lt;BR /&gt;&lt;BR /&gt; I tried the suggested approach, it didn't work with me. I read a little in the "CPU12 Reference Manual" and figured the reason is probably that the HC12 differentiates between 4 types of Reset (Power-On, External Reset, COP/Watchdog and Clock Monitor Reset). The first two types use the same Reset vector, the other two have their own vectors.&lt;BR /&gt;&lt;BR /&gt; Another possibility which I have used is to wire the (open drain) /RESET pin to an I/O pin (possibly with a diode in between?). Now if you make the I/O pin be a LOW output, it resets the controller (making the I/O pin an input).&lt;BR /&gt;&lt;BR /&gt; Notice:&lt;BR /&gt; a) without the diode the I/O pin should not be set to be a HIGH output (potential short-circuit)&lt;BR /&gt; b) this is not a pure SW method&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="gensmall"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jan 2006 11:06:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Resetting-HCS12-using-software/m-p/125076#M243</guid>
      <dc:creator>RChapman</dc:creator>
      <dc:date>2006-01-28T11:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting HCS12 using software</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Resetting-HCS12-using-software/m-p/125077#M244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was sawing some tips in the forum about the watchdog timer and I have some questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;actually&lt;BR /&gt;I'm working with the HCS12 microcontroller and I need to use the&lt;BR /&gt;watchdog timer in order to do&amp;nbsp; reset. I've configurated the COPCTL&lt;BR /&gt;register with 71 &lt;FONT color="#ff0000"&gt;(COPCTL=71)&lt;/FONT&gt; the program&lt;BR /&gt;stay in a infinite for loop showing a caracter ascii in the&lt;BR /&gt;hyperterminal until the watchdog finish. The problem is:&amp;nbsp; after the&lt;BR /&gt;watchdog timer has finished the program doesn't reset o may be yes, but&lt;BR /&gt;I can't see more caracters in the hyperterminal until I do a manual&lt;BR /&gt;reset.&amp;nbsp; I've attached the program. I hope that you can help me. many&lt;BR /&gt;thanks.&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
This is the main function:



 void main(void) {
  /* put your own code here */

  char msn[20]={"Hola"};
  char msn1[5]={"."}; 
  word cont1X;
  word cont2X;

  cont2X=0;
  while(cont2X&amp;lt;=5000)
  {
    cont2X++;
    cont1X=0;
    while(cont1X&amp;lt;=100)
    {
      asm BRN *;
      cont1X++;    
    }    
  }

  SCI0BD = 12;

  SCI0CR1 = 0x00;

  SCI0CR2 = 0x04;

  vfnSCITxMsg(msn);
  COPCTL=71;
  
  for(;;) {
  cont2X=0;
  while(cont2X&amp;lt;=5000)
  {
    cont2X++;
    cont1X=0;
    while(cont1X&amp;lt;=100)
    {
      asm BRN *;
      cont1X++;    
    }    
  }
  vfnSCITxMsg(msn1);
  } /* loop forever */
  /* please make sure that you never leave main */
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2009 21:50:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Resetting-HCS12-using-software/m-p/125077#M244</guid>
      <dc:creator>wilero17</dc:creator>
      <dc:date>2009-08-25T21:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Resetting HCS12 using software</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Resetting-HCS12-using-software/m-p/1458261#M18656</link>
      <description>thank you It worked well</description>
      <pubDate>Sun, 15 May 2022 12:33:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Resetting-HCS12-using-software/m-p/1458261#M18656</guid>
      <dc:creator>javadshabani</dc:creator>
      <dc:date>2022-05-15T12:33:08Z</dc:date>
    </item>
  </channel>
</rss>

