<?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>Kinetis MicrocontrollersのトピックRe: Bootclock initialization on a mk20dx</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootclock-initialization-on-a-mk20dx/m-p/847179#M50992</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robin&lt;/P&gt;&lt;P&gt;I found the answer i the meanwhile.&amp;nbsp;&amp;nbsp;I have&amp;nbsp;to call CLOCK_SetXtal0Freq() in the SDK&amp;nbsp; or else the CLOCK_GetFreq() won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;JAcob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Dec 2018 06:10:36 GMT</pubDate>
    <dc:creator>jacobandersen</dc:creator>
    <dc:date>2018-12-14T06:10:36Z</dc:date>
    <item>
      <title>Bootclock initialization on a mk20dx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootclock-initialization-on-a-mk20dx/m-p/847177#M50990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I'm using a MK20DX256 in a project. Normally i have used the generated BOARD_InitBootClocks()&amp;nbsp; to initialize the clock without problems but now i want to do it early in&amp;nbsp; SystemInit()&amp;nbsp;because of a library that depends on it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to pasted the following code to the original SystemInit() after the watchdog initialization and for some reason the CPU dies. Is there a conflict with the&amp;nbsp;mcuXpresso sdk if i'm doing it that way. I cannot figure out what's going wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;/* SIM-&amp;gt;CLKDIV1: OUTDIV1=0,OUTDIV2=0,OUTDIV4=1 Set Prescalers 72MHz cpu, 36MHz bus, 24MHz flash*/&lt;BR /&gt; SIM-&amp;gt;CLKDIV1 = SIM_CLKDIV1_OUTDIV2(1) | SIM_CLKDIV1_OUTDIV4(2);&lt;BR /&gt; /* SIM-&amp;gt;CLKDIV2: USBDIV=2,USBFRAC=1 Divide 72MHz system clock for USB 48MHz */&lt;BR /&gt; SIM-&amp;gt;CLKDIV2 = SIM_CLKDIV2_USBDIV(2) | SIM_CLKDIV2_USBFRAC_MASK;&lt;BR /&gt; /* OSC0-&amp;gt;CR: ERCLKEN=0,EREFSTEN=0,SC2P=1,SC4P=0,SC8P=1,SC16P=0 10pF loading capacitors for 16MHz system oscillator*/&lt;BR /&gt; OSC0-&amp;gt;CR = OSC_CR_SC8P_MASK | OSC_CR_SC2P_MASK;&lt;BR /&gt; /* Switch to FBE Mode */&lt;BR /&gt; /* MCG-&amp;gt;C7: OSCSEL=0 */&lt;BR /&gt; MCG-&amp;gt;C7 = (uint8_t)0x00u;&lt;BR /&gt; /* MCG-&amp;gt;C2: LOCKRE0=0,RANGE0=2,HGO=0,EREFS=1,LP=0,IRCS=0 */&lt;BR /&gt; MCG-&amp;gt;C2 = MCG_C2_RANGE0(2) | MCG_C2_EREFS0_MASK;&lt;BR /&gt; //MCG-&amp;gt;C2 = (uint8_t)0x24u;&lt;BR /&gt; /* MCG-&amp;gt;C1: CLKS=2,FRDIV=3,IREFS=0,IRCLKEN=1,IREFSTEN=0 */&lt;BR /&gt; MCG-&amp;gt;C1 = MCG_C1_CLKS(2) | MCG_C1_FRDIV(3) | MCG_C1_IRCLKEN_MASK;&lt;BR /&gt; /* MCG-&amp;gt;C4: DMX32=0,DRST_DRS=0,FCTRIM=0,SCFTRIM=0 */&lt;BR /&gt; MCG-&amp;gt;C4 &amp;amp;= (uint8_t)~(uint8_t)0xE0u;&lt;BR /&gt; /* MCG-&amp;gt;C5: PLLCLKEN=0,PLLSTEN=0,PRDIV0=7 */&lt;BR /&gt; MCG-&amp;gt;C5 = MCG_C5_PRDIV0(7);&lt;BR /&gt; /* MCG-&amp;gt;C6: LOLIE=0,PLLS=0,CME=0,VDIV0=0 */&lt;BR /&gt; MCG-&amp;gt;C6 = (uint8_t)0x00u;&lt;BR /&gt; while((MCG-&amp;gt;S &amp;amp; MCG_S_OSCINIT0_MASK) == 0u) { } /* Check that the oscillator is running */&lt;BR /&gt; while((MCG-&amp;gt;S &amp;amp; 0x0Cu) != 0x08u) { } /* Wait until external reference clock is selected as MCG output */&lt;BR /&gt; /* Switch to PBE Mode */&lt;BR /&gt; /* MCG_C5: PLLCLKEN=0,PLLSTEN=0,PRDIV0=5 */&lt;BR /&gt; MCG-&amp;gt;C5 = MCG_C5_PRDIV0(5);&lt;BR /&gt; /* MCG-&amp;gt;C6: LOLIE=0,PLLS=1,CME=0,VDIV0=3 */&lt;BR /&gt; MCG-&amp;gt;C6 = MCG_C6_PLLS_MASK | MCG_C6_VDIV0(3);&lt;BR /&gt; while((MCG-&amp;gt;S &amp;amp; MCG_S_PLLST_MASK) == 0u) { } /* Wait until the source of the PLLS clock has switched to the PLL */&lt;BR /&gt; while((MCG-&amp;gt;S &amp;amp; MCG_S_LOCK0_MASK) == 0u) { } /* Wait until locked */&lt;BR /&gt; /* Switch to PEE Mode */&lt;BR /&gt; /* MCG-&amp;gt;C1: CLKS=0,FRDIV=2,IREFS=0,IRCLKEN=1,IREFSTEN=0 */&lt;BR /&gt; MCG-&amp;gt;C1 = MCG_C1_FRDIV(2) | MCG_C1_IRCLKEN_MASK;&lt;BR /&gt; while((MCG-&amp;gt;S &amp;amp; 0x0Cu) != 0x0Cu) { } /* Wait until output of the PLL is selected */&lt;BR /&gt; while((MCG-&amp;gt;S &amp;amp; MCG_S_LOCK0_MASK) == 0u) { } /* Wait until locked */&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jacob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2018 08:23:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootclock-initialization-on-a-mk20dx/m-p/847177#M50990</guid>
      <dc:creator>jacobandersen</dc:creator>
      <dc:date>2018-12-10T08:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Bootclock initialization on a mk20dx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootclock-initialization-on-a-mk20dx/m-p/847178#M50991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jacob,&lt;/P&gt;&lt;P&gt;Sorry for my late reply!&lt;BR /&gt;Would you please tell me the full part number of your MCU?&lt;BR /&gt;I did not find the MK20 72MHz in the support list of MCUXPresso SDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2018 03:12:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootclock-initialization-on-a-mk20dx/m-p/847178#M50991</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2018-12-14T03:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Bootclock initialization on a mk20dx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootclock-initialization-on-a-mk20dx/m-p/847179#M50992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robin&lt;/P&gt;&lt;P&gt;I found the answer i the meanwhile.&amp;nbsp;&amp;nbsp;I have&amp;nbsp;to call CLOCK_SetXtal0Freq() in the SDK&amp;nbsp; or else the CLOCK_GetFreq() won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;JAcob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2018 06:10:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootclock-initialization-on-a-mk20dx/m-p/847179#M50992</guid>
      <dc:creator>jacobandersen</dc:creator>
      <dc:date>2018-12-14T06:10:36Z</dc:date>
    </item>
  </channel>
</rss>

