<?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のトピックRe: Constant COP Reset</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Constant-COP-Reset/m-p/685205#M14320</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;During the reset sequence, CPMUCOP register is initialized based on a value stored in FOPT byte at the address 0x3_FF0E. FOPT bits [2:0] are negated and loaded to bits CR[2:0] in CPMUCOP register. This will set the watchdog time-out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check what value is stored at the address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the FOPT contains default value 0xFF then the watchdog is disabled.&lt;/P&gt;&lt;P&gt;So, if you write 0xFF to FOPT then, after next reset, the watchdog will be disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//set FOPT = 0xFF at 0xFF0E&lt;/P&gt;&lt;P&gt;//place the constant at address 0xFF08&lt;/P&gt;&lt;P&gt;const unsigned char flash_array[] @0xFF08= {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE};&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>Thu, 06 Jul 2017 13:58:14 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2017-07-06T13:58:14Z</dc:date>
    <item>
      <title>Constant COP Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Constant-COP-Reset/m-p/685203#M14318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to help a colleague who is writing in ASM try to debug a persistent reset. It happens at 16.xxx seconds like clock work. The unit runs for 16 seconds, triggers a reset and runs for another 16s. The reset appears to be caused by the COP watchdog. We are using an MC9S12P MCU. The code is applied from an existing platform that has been working for some time. Basically the same platform with more I/O. So, we are confused as to why we are seeing problems here. The MCU is running at 16 MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure where to start. So, I will begin with the clock initialization. Here's the code snippet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;ldaa&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #$26&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; old. Allow access to CPU clock settings&amp;nbsp;&amp;nbsp;&amp;nbsp; 
staa&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CPMUPROT
movb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#%10000011,CPMUCLKS&amp;nbsp;&amp;nbsp;&amp;nbsp; ; turn on PLL. Run RTI from OSCCLK&amp;nbsp;&amp;nbsp; 
movb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #%00000000,CPMUHTCTL&amp;nbsp;&amp;nbsp; ; not reading the internal temp sensor 
movb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #%00001111,CPMUSYNR&amp;nbsp;&amp;nbsp;&amp;nbsp; ; set the freq reduction to obtain F-ref 
movb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #%00001111,CPMUREFDIV&amp;nbsp; ; set divider to get F-ref from crystal freq 
movb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #%00000000,CPMUPOSTDIV
movb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #%11000001,CPMUOSC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; turn on the external oscillator&amp;nbsp; 
ldaa&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #1
staa&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CPMUPROT &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;/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;&lt;/P&gt;&lt;P&gt;We have tried writing 0x00 to the CPMUCOP to no avail. We are a little confused as to the statement in the COP Control Register Description stating "When a non-zero value is loaded from Flash to CR[0:2] the COP time-out period is started." Where in flash is this value, and how do you change it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A vague question will get a vague answer, but I hope it will move us in the right direction. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 23:42:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Constant-COP-Reset/m-p/685203#M14318</guid>
      <dc:creator>rmaier</dc:creator>
      <dc:date>2017-07-05T23:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Constant COP Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Constant-COP-Reset/m-p/685204#M14319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more thing to add. While the MCU is running, the CPMUCOP register shows 0b10000111. So, Window COP Mode and 2^24 cycles for COP Watchdog Timer Rate. Even if we initialize CPMUCOP = 0. Does the CPMUCOP need to be initialized in a special location?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2017 13:57:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Constant-COP-Reset/m-p/685204#M14319</guid>
      <dc:creator>rmaier</dc:creator>
      <dc:date>2017-07-06T13:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Constant COP Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Constant-COP-Reset/m-p/685205#M14320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;During the reset sequence, CPMUCOP register is initialized based on a value stored in FOPT byte at the address 0x3_FF0E. FOPT bits [2:0] are negated and loaded to bits CR[2:0] in CPMUCOP register. This will set the watchdog time-out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check what value is stored at the address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the FOPT contains default value 0xFF then the watchdog is disabled.&lt;/P&gt;&lt;P&gt;So, if you write 0xFF to FOPT then, after next reset, the watchdog will be disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//set FOPT = 0xFF at 0xFF0E&lt;/P&gt;&lt;P&gt;//place the constant at address 0xFF08&lt;/P&gt;&lt;P&gt;const unsigned char flash_array[] @0xFF08= {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE};&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>Thu, 06 Jul 2017 13:58:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Constant-COP-Reset/m-p/685205#M14320</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2017-07-06T13:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Constant COP Reset</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Constant-COP-Reset/m-p/685206#M14321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was the trick. Many thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 12:56:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Constant-COP-Reset/m-p/685206#M14321</guid>
      <dc:creator>rmaier</dc:creator>
      <dc:date>2017-07-07T12:56:41Z</dc:date>
    </item>
  </channel>
</rss>

