<?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: Set up the System Clock and WDOG timeout in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Set-up-the-System-Clock-and-WDOG-timeout/m-p/311373#M13426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are not taking into consideration the COP/Watchdog does not use the Core clock as a reference but the BUS clk, which is 1/2 the core clock; thus the reason to observe only half the time period.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Apr 2014 20:20:49 GMT</pubDate>
    <dc:creator>apanecatl</dc:creator>
    <dc:date>2014-04-08T20:20:49Z</dc:date>
    <item>
      <title>Set up the System Clock and WDOG timeout</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Set-up-the-System-Clock-and-WDOG-timeout/m-p/311372#M13425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I hope anyone can help me....&lt;/P&gt;&lt;P&gt;First of all, my facts:&lt;/P&gt;&lt;P&gt;I'm using CW V.1.4 (without PEX), to program a MK20DX128 (50MHz)&amp;nbsp; There aren't any Problems while compilation but it doesn't work anyway.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to generate a system clock of&lt;SPAN style="color: #ff0000;"&gt; 48MHz&lt;/SPAN&gt; with the help of the &lt;SPAN style="color: #ff0000;"&gt;PLL &lt;SPAN style="color: #000000;"&gt;and an&lt;/SPAN&gt; external oszillator of 8MHz.&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;So I followed the datasheet to change the mode from FEI to PEE (see my zip file CLOCK.c // CLOCK_init())&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a fault in this initialisaton?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in my opinion it should work^^ Now I would like to set up the WDOG timeout and there is my main problem!&lt;/P&gt;&lt;P&gt;I made the following calculation:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have got a 48MHz System Clock =&amp;gt; 1/48MHz = 20,83ns per tick&lt;/P&gt;&lt;P&gt;I have got two 16bit Timout Registers for the WDOG so there are 32bit in addition. =&amp;gt; 2^32 = 4,294,967,296&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I multiply the seconds per tick and the WDOG Register Value!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=&amp;gt; 20,83ns * 4,294,967,296 = &lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #ff0000; text-decoration: underline;"&gt;89,46s&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #ff0000; text-decoration: underline;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;There is the probelem! I have measuered the time and get a time of only 44,7s!!! So it's exactly the half time. Where is my fault in this calculation?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;By the way I have got the same fault while using the PIT Module!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Thanks a lot to all!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;Pascal&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337359"&gt;CLOCK.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Apr 2014 15:32:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Set-up-the-System-Clock-and-WDOG-timeout/m-p/311372#M13425</guid>
      <dc:creator>pascalschröer</dc:creator>
      <dc:date>2014-04-06T15:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set up the System Clock and WDOG timeout</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Set-up-the-System-Clock-and-WDOG-timeout/m-p/311373#M13426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are not taking into consideration the COP/Watchdog does not use the Core clock as a reference but the BUS clk, which is 1/2 the core clock; thus the reason to observe only half the time period.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 20:20:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Set-up-the-System-Clock-and-WDOG-timeout/m-p/311373#M13426</guid>
      <dc:creator>apanecatl</dc:creator>
      <dc:date>2014-04-08T20:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Set up the System Clock and WDOG timeout</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Set-up-the-System-Clock-and-WDOG-timeout/m-p/311374#M13427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay but if the BUS clk is 1/2 core clock the WDOG should reset every second time periods or?&lt;/P&gt;&lt;P&gt;I think I have solved the problem with setting the MCG_C2 register from 0x1C to 0x2C... now it works&lt;/P&gt;&lt;P&gt;like I would expect it :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 20:48:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Set-up-the-System-Clock-and-WDOG-timeout/m-p/311374#M13427</guid>
      <dc:creator>pascalschröer</dc:creator>
      <dc:date>2014-04-08T20:48:16Z</dc:date>
    </item>
  </channel>
</rss>

