<?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: MK10 PLL clock configuration in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK10-PLL-clock-configuration/m-p/1341420#M61496</link>
    <description>&lt;P&gt;Hi&amp;nbsp;davithakobyan,&lt;/P&gt;
&lt;P&gt;Are you using an external &lt;STRONG&gt;crystal&lt;/STRONG&gt; or external &lt;STRONG&gt;reference clock&lt;/STRONG&gt; source?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Crystal or external reference clock.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156275i4E1D13552BFBF35B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Crystal or external reference clock.png" alt="Crystal or external reference clock.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here is the difference:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clock tools.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156278i098981E023E06C35/image-size/large?v=v2&amp;amp;px=999" role="button" title="clock tools.png" alt="clock tools.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In addition, you can also check if there is a matching &lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k1x-mainstream/kinetis-k10-100-mhz-mixed-signal-integration-microcontrollers-mcus-based-on-arm-cortex-m4-core:K10_100?tab=Documentation_Tab" target="_self"&gt;errata&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Please check the mask of MCU, make sure the part number is MK10DN512VLL10 not MK10DN512&lt;STRONG&gt;Z&lt;/STRONG&gt;VLL10&lt;/P&gt;
&lt;P&gt;The codes shown below belong to&amp;nbsp;&lt;STRONG&gt;CLOCK_BootToBlpeMode&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;CLOCK_SetPbeMode&lt;/STRONG&gt;. Did you call these function?&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;    while ((MCG-&amp;gt;S &amp;amp; (MCG_S_IREFST_MASK | MCG_S_CLKST_MASK)) !=
           (MCG_S_IREFST(kMCG_FllSrcExternal) | MCG_S_CLKST(kMCG_ClkOutStatExt)))
    {
    }&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
    <pubDate>Thu, 16 Sep 2021 08:48:11 GMT</pubDate>
    <dc:creator>Robin_Shen</dc:creator>
    <dc:date>2021-09-16T08:48:11Z</dc:date>
    <item>
      <title>MK10 PLL clock configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK10-PLL-clock-configuration/m-p/1340476#M61484</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I try to run a sample project for MK10DN512VLL10 by configuring the clock to use the external OSC and run at 100 MHz of PLL. However, the execution hangs in a while loop for waiting the clock source to be set to external clock reference. The relevant parts are as follows:&lt;/P&gt;&lt;P&gt;&lt;U&gt;Configuration part&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;const mcg_config_t mcgConfig_BOARD_BootClockRUN =
    {
        .mcgMode = kMCG_ModePEE,                  /* PEE - PLL Engaged External */
        .irclkEnableMode = MCG_IRCLK_DISABLE,     /* MCGIRCLK disabled */
        .ircs = kMCG_IrcSlow,                     /* Slow internal reference clock selected */
        .fcrdiv = 0x1U,                           /* Fast IRC divider: divided by 2 */
        .frdiv = 0x0U,                            /* FLL reference clock divider: divided by 1 */
        .drs = kMCG_DrsLow,                       /* Low frequency range */
        .dmx32 = kMCG_Dmx32Default,               /* DCO has a default range of 25% */
        .oscsel = kMCG_OscselOsc,                 /* Selects System Oscillator (OSCCLK) */
        .pll0Config =
            {
                .enableMode = kMCG_PllEnableIndependent,/* MCGPLLCLK enabled independent of MCG clock mode, MCGPLLCLK disabled in STOP mode */
                .prdiv = 0x3U,                    /* PLL Reference divider: divided by 4 */
                .vdiv = 0x1aU,                    /* VCO divider: multiplied by 50 */
            },
    };
const sim_clock_config_t simConfig_BOARD_BootClockRUN =
    {
        .pllFllSel = SIM_PLLFLLSEL_MCGFLLCLK_CLK, /* PLLFLL select: MCGFLLCLK clock */
        .er32ksrc=SIM_OSC32KSEL_OSC32KCLK_CLK,  /* OSC32KSEL select: OSC32KCLK clock */
        .clkdiv1 = 0x1130000U,                    /* SIM_CLKDIV1 - OUTDIV1: /1, OUTDIV2: /2, OUTDIV3: /2, OUTDIV4: /4 */
    };
const osc_config_t oscConfig_BOARD_BootClockRUN =
    {
        .freq = 8000000U,                         /* Oscillator frequency: 8000000Hz */
        .capLoad = (OSC_CAP0P),                   /* Oscillator capacity load: 0pF */
        .workMode = kOSC_ModeExt,                 /* Use external clock */
        .oscerConfig =
            {
                .enableMode = OSC_ER_CLK_DISABLE, /* Disable external reference clock */
            }
    };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Setting up the clock&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;void BOARD_BootClockRUN(void)
{
    /* Set the system clock dividers in SIM to safe value. */
    CLOCK_SetSimSafeDivs();
    /* Initializes OSC0 according to board configuration. */
    CLOCK_InitOsc0(&amp;amp;oscConfig_BOARD_BootClockRUN);
    CLOCK_SetXtal0Freq(oscConfig_BOARD_BootClockRUN.freq);
    /* Configure FLL external reference divider (FRDIV). */
    CLOCK_CONFIG_SetFllExtRefDiv(mcgConfig_BOARD_BootClockRUN.frdiv);
    /* Set MCG to PEE mode. */
    CLOCK_BootToPeeMode(mcgConfig_BOARD_BootClockRUN.oscsel,
                        kMCG_PllClkSelPll0,
                        &amp;amp;mcgConfig_BOARD_BootClockRUN.pll0Config);
    /* Set the clock configuration in SIM module. */
    CLOCK_SetSimConfig(&amp;amp;simConfig_BOARD_BootClockRUN);
    /* Set SystemCoreClock variable. */
    SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem occurs in the above CLOCK_BootToPeeMode function. Particularly, it hangs in the following check:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    while ((MCG-&amp;gt;S &amp;amp; (MCG_S_IREFST_MASK | MCG_S_CLKST_MASK)) !=
           (MCG_S_IREFST(kMCG_FllSrcExternal) | MCG_S_CLKST(kMCG_ClkOutStatExt)))
    {
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know the reason why it is not possible to set the external ref. clock?&lt;/P&gt;&lt;P&gt;Does anyone have a working clock initialization procedure which one could use?&lt;/P&gt;&lt;P&gt;Thanks a lot in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 09:21:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK10-PLL-clock-configuration/m-p/1340476#M61484</guid>
      <dc:creator>davithakobyan</dc:creator>
      <dc:date>2021-09-15T09:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: MK10 PLL clock configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK10-PLL-clock-configuration/m-p/1341420#M61496</link>
      <description>&lt;P&gt;Hi&amp;nbsp;davithakobyan,&lt;/P&gt;
&lt;P&gt;Are you using an external &lt;STRONG&gt;crystal&lt;/STRONG&gt; or external &lt;STRONG&gt;reference clock&lt;/STRONG&gt; source?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Crystal or external reference clock.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156275i4E1D13552BFBF35B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Crystal or external reference clock.png" alt="Crystal or external reference clock.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here is the difference:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clock tools.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/156278i098981E023E06C35/image-size/large?v=v2&amp;amp;px=999" role="button" title="clock tools.png" alt="clock tools.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In addition, you can also check if there is a matching &lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k1x-mainstream/kinetis-k10-100-mhz-mixed-signal-integration-microcontrollers-mcus-based-on-arm-cortex-m4-core:K10_100?tab=Documentation_Tab" target="_self"&gt;errata&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Please check the mask of MCU, make sure the part number is MK10DN512VLL10 not MK10DN512&lt;STRONG&gt;Z&lt;/STRONG&gt;VLL10&lt;/P&gt;
&lt;P&gt;The codes shown below belong to&amp;nbsp;&lt;STRONG&gt;CLOCK_BootToBlpeMode&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;CLOCK_SetPbeMode&lt;/STRONG&gt;. Did you call these function?&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;    while ((MCG-&amp;gt;S &amp;amp; (MCG_S_IREFST_MASK | MCG_S_CLKST_MASK)) !=
           (MCG_S_IREFST(kMCG_FllSrcExternal) | MCG_S_CLKST(kMCG_ClkOutStatExt)))
    {
    }&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 08:48:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MK10-PLL-clock-configuration/m-p/1341420#M61496</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2021-09-16T08:48:11Z</dc:date>
    </item>
  </channel>
</rss>

