<?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 Not able to Re-initialize Watchdog clock as OSCCLK in S12G micro in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-able-to-Re-initialize-Watchdog-clock-as-OSCCLK-in-S12G-micro/m-p/587024#M12930</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 a problem in re-initializing the COPOSCSEL0&amp;nbsp; register.&lt;/P&gt;&lt;P&gt;I do work on S12G micro controller and I have bootloader and application flashed on the micro.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here, In bootloader I do initialize the CPU registers as shown below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CPMUCOP&amp;nbsp;&amp;nbsp; = 0x44;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CPMUPROT&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x26;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUCLKS&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUOSC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUREFDIV&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUSYNR&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x01;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUPOSTDIV = 0x00;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUPLL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00;&lt;/P&gt;&lt;P&gt;while (!UPOSC){}&lt;/P&gt;&lt;P&gt;CPMUCLKS&amp;nbsp;&amp;nbsp; |= 3;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, in application I&amp;nbsp; do initialize the CPU registers in the same way except watchdog.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CPMUPROT&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x26;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUCLKS&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUOSC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUREFDIV&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUSYNR&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x01;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUPOSTDIV = 0x00;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUPLL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00;&lt;/P&gt;&lt;P&gt;while (!UPOSC){}&lt;/P&gt;&lt;P&gt;CPMUCLKS&amp;nbsp;&amp;nbsp; |= 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CPMUPROT&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x01;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am initializing the CPMUCOP = 0x44 far later the initialization of CPU clock regusters.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now, please look into the observations below,&lt;/P&gt;&lt;P&gt;1) When I flash application only, and monitor the CPMUCLKS register value at run time, I can observe 0x83,&lt;/P&gt;&lt;P&gt;2) When I flash bootloader only, and monitor the CPMUCLKS register value at run time, I can observe 0x83.&lt;/P&gt;&lt;P&gt;3) But when both the bootloader and application are flashed on to the board, and when the control is in application now I can read CPMUCLKS value as 0x82 only.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in the 3rd observation I can see COPOSCSEL0 is not set, but I need that bit to be set because OSCCLK should be used for COP on my project.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, One more observation I have made in application is I am initializing the CPMUCOP far later the initialization of CPU clock regusters.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I observed is when control jumps from bootloader to application watchdog is already initialized and when I try to set the COPOSCSEL0 bit CPMUCOP register, It is not&amp;nbsp; at all set.&lt;/P&gt;&lt;P&gt;What should I do to set the COPOSCSEL0 bit in application when bootloader is present.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any dependency between the COPOSCSEL0&amp;nbsp; and CPMUCOP registers?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ganesh Vijaya Kumar P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Sep 2016 05:36:09 GMT</pubDate>
    <dc:creator>ganeshvijayakum</dc:creator>
    <dc:date>2016-09-02T05:36:09Z</dc:date>
    <item>
      <title>Not able to Re-initialize Watchdog clock as OSCCLK in S12G micro</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-able-to-Re-initialize-Watchdog-clock-as-OSCCLK-in-S12G-micro/m-p/587024#M12930</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 a problem in re-initializing the COPOSCSEL0&amp;nbsp; register.&lt;/P&gt;&lt;P&gt;I do work on S12G micro controller and I have bootloader and application flashed on the micro.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here, In bootloader I do initialize the CPU registers as shown below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CPMUCOP&amp;nbsp;&amp;nbsp; = 0x44;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CPMUPROT&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x26;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUCLKS&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUOSC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUREFDIV&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUSYNR&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x01;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUPOSTDIV = 0x00;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUPLL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00;&lt;/P&gt;&lt;P&gt;while (!UPOSC){}&lt;/P&gt;&lt;P&gt;CPMUCLKS&amp;nbsp;&amp;nbsp; |= 3;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, in application I&amp;nbsp; do initialize the CPU registers in the same way except watchdog.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CPMUPROT&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x26;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUCLKS&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUOSC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUREFDIV&amp;nbsp; = 0x80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUSYNR&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x01;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUPOSTDIV = 0x00;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CPMUPLL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00;&lt;/P&gt;&lt;P&gt;while (!UPOSC){}&lt;/P&gt;&lt;P&gt;CPMUCLKS&amp;nbsp;&amp;nbsp; |= 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CPMUPROT&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x01;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am initializing the CPMUCOP = 0x44 far later the initialization of CPU clock regusters.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now, please look into the observations below,&lt;/P&gt;&lt;P&gt;1) When I flash application only, and monitor the CPMUCLKS register value at run time, I can observe 0x83,&lt;/P&gt;&lt;P&gt;2) When I flash bootloader only, and monitor the CPMUCLKS register value at run time, I can observe 0x83.&lt;/P&gt;&lt;P&gt;3) But when both the bootloader and application are flashed on to the board, and when the control is in application now I can read CPMUCLKS value as 0x82 only.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in the 3rd observation I can see COPOSCSEL0 is not set, but I need that bit to be set because OSCCLK should be used for COP on my project.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, One more observation I have made in application is I am initializing the CPMUCOP far later the initialization of CPU clock regusters.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I observed is when control jumps from bootloader to application watchdog is already initialized and when I try to set the COPOSCSEL0 bit CPMUCOP register, It is not&amp;nbsp; at all set.&lt;/P&gt;&lt;P&gt;What should I do to set the COPOSCSEL0 bit in application when bootloader is present.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any dependency between the COPOSCSEL0&amp;nbsp; and CPMUCOP registers?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ganesh Vijaya Kumar P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 05:36:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-able-to-Re-initialize-Watchdog-clock-as-OSCCLK-in-S12G-micro/m-p/587024#M12930</guid>
      <dc:creator>ganeshvijayakum</dc:creator>
      <dc:date>2016-09-02T05:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to Re-initialize Watchdog clock as OSCCLK in S12G micro</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-able-to-Re-initialize-Watchdog-clock-as-OSCCLK-in-S12G-micro/m-p/587025#M12931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ganesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is an important note in the S12G datasheet below CPMUCLKS register description:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"After writing CPMUCLKS register, it is strongly recommended to read&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;back CPMUCLKS register to make sure that write of PLLSEL,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;RTIOSCSEL, COPOSCSEL0 and COPOSCSEL1 was successful."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So something like this we have in our SW examples for setting PLL:&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 15px;"&gt;CPMUCLKS = 0B10000011; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 15px;"&gt;if(CPMUCLKS != 0B10000011) {asm nop;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;Next, in your third observation, when you combine bootloader and application, do you write CPMUCLKS twice?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;It would be better to have it once write and then read back.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;The dependency is that "&lt;EM&gt;a change of the COPOSCSEL0 or COPSOCSEL1 bit (writing a different value)..., re-starts the COP time-out period.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;Regards,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;iggi&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 09:26:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Not-able-to-Re-initialize-Watchdog-clock-as-OSCCLK-in-S12G-micro/m-p/587025#M12931</guid>
      <dc:creator>iggi</dc:creator>
      <dc:date>2016-09-02T09:26:19Z</dc:date>
    </item>
  </channel>
</rss>

