<?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: fcrdiv in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/fcrdiv/m-p/623267#M37310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;Have you try to test the power_manager demo in &lt;A href="https://mcuxpresso.nxp.com/en/welcome"&gt;SDK_2.1_TWR-K65F180M&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="power_manager.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/19708iE470C68555407501/image-size/large?v=v2&amp;amp;px=999" role="button" title="power_manager.png" alt="power_manager.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After input D , the MCU will enter VLPR. And you will get the Core Clock = 4MHz.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="serial terminal.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/19665i3315FB535552B878/image-size/large?v=v2&amp;amp;px=999" role="button" title="serial terminal.png" alt="serial terminal.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can observe the 4MHz MCGIRCLK on CLKOUT pin(PTC3):&lt;/P&gt;&lt;P&gt;1. Open the Clock Gate of PORTC.&amp;nbsp; &lt;STRONG&gt;CLOCK_EnableClock(kCLOCK_PortC);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2. Select the Pin Mux of PORTC3 to Alternative 5 as CLKOUT function. &lt;STRONG&gt;PORT_SetPinMux(PORTC, 3u, kPORT_MuxAlt5);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;3. Select the MCGIRCLK to output on the CLKOUT pin. &lt;STRONG&gt;CLOCK_SetClkOutClock(0x04);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Clocking diagram.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/19848i39CFC5C053B0F8BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clocking diagram.png" alt="Clocking diagram.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="CLKOUT SIM_SOPT2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/19893i8BB80B14DC2A476B/image-size/large?v=v2&amp;amp;px=999" role="button" title="CLKOUT SIM_SOPT2.png" alt="CLKOUT SIM_SOPT2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also below information.(It seems that you have already notice these informations.)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="MCG_SC[FCRDIV].png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/21052i137B5636D2F0954C/image-size/large?v=v2&amp;amp;px=999" role="button" title="MCG_SC[FCRDIV].png" alt="MCG_SC[FCRDIV].png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="VLPR mode clocking.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/21093i06D0910F4B117887/image-size/large?v=v2&amp;amp;px=999" role="button" title="VLPR mode clocking.png" alt="VLPR mode clocking.png" /&gt;&lt;/span&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>Thu, 16 Feb 2017 03:29:58 GMT</pubDate>
    <dc:creator>Robin_Shen</dc:creator>
    <dc:date>2017-02-16T03:29:58Z</dc:date>
    <item>
      <title>fcrdiv</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/fcrdiv/m-p/623266#M37309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;using FCRDIV to get to 4 Mhz in VLPR mode&amp;nbsp;on the Kinetis K65.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upon bootup while in FEI state I set MCG_SC_FCRDIV(0).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code then transitions to RUN mode running of an external oscillator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our code will transition into and out of VLPR mode from the run mode depending if there is processing that needs to be done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever we go into VLPR mode running off the internal 4 Mhz clock&amp;nbsp;we only see a clock out of 2 Mhz. It acts like my setting of FCRDIV is not working. If I set it to zero the divider should be 1 and then I should see a 4 Mhz output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While in VLPR the SIMDIV has been set to 0 for core, system, and flexbus. That means there is no divider on MSGCLKOUT. The flash clock is set to make sure the flash clock restriction is met while in VLPR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2017 15:59:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/fcrdiv/m-p/623266#M37309</guid>
      <dc:creator>Chris_T</dc:creator>
      <dc:date>2017-02-13T15:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: fcrdiv</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/fcrdiv/m-p/623267#M37310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;Have you try to test the power_manager demo in &lt;A href="https://mcuxpresso.nxp.com/en/welcome"&gt;SDK_2.1_TWR-K65F180M&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="power_manager.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/19708iE470C68555407501/image-size/large?v=v2&amp;amp;px=999" role="button" title="power_manager.png" alt="power_manager.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After input D , the MCU will enter VLPR. And you will get the Core Clock = 4MHz.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="serial terminal.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/19665i3315FB535552B878/image-size/large?v=v2&amp;amp;px=999" role="button" title="serial terminal.png" alt="serial terminal.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You can observe the 4MHz MCGIRCLK on CLKOUT pin(PTC3):&lt;/P&gt;&lt;P&gt;1. Open the Clock Gate of PORTC.&amp;nbsp; &lt;STRONG&gt;CLOCK_EnableClock(kCLOCK_PortC);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2. Select the Pin Mux of PORTC3 to Alternative 5 as CLKOUT function. &lt;STRONG&gt;PORT_SetPinMux(PORTC, 3u, kPORT_MuxAlt5);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;3. Select the MCGIRCLK to output on the CLKOUT pin. &lt;STRONG&gt;CLOCK_SetClkOutClock(0x04);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Clocking diagram.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/19848i39CFC5C053B0F8BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clocking diagram.png" alt="Clocking diagram.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="CLKOUT SIM_SOPT2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/19893i8BB80B14DC2A476B/image-size/large?v=v2&amp;amp;px=999" role="button" title="CLKOUT SIM_SOPT2.png" alt="CLKOUT SIM_SOPT2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also below information.(It seems that you have already notice these informations.)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="MCG_SC[FCRDIV].png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/21052i137B5636D2F0954C/image-size/large?v=v2&amp;amp;px=999" role="button" title="MCG_SC[FCRDIV].png" alt="MCG_SC[FCRDIV].png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="VLPR mode clocking.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/21093i06D0910F4B117887/image-size/large?v=v2&amp;amp;px=999" role="button" title="VLPR mode clocking.png" alt="VLPR mode clocking.png" /&gt;&lt;/span&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>Thu, 16 Feb 2017 03:29:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/fcrdiv/m-p/623267#M37310</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2017-02-16T03:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: fcrdiv</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/fcrdiv/m-p/623268#M37311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you robin. Unfortunately the code that I work with will not work on the tower.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do have some more questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I am setting the MGC_SC and the SIM_DIV registers before entering VLPR. I actually set up the MGC_SC register in the FEI state. Does the FCRDIV setting have any effect while in in any other mode such as RUN as long as the internal fast clock is not enabled?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Does this setting of FCRDIV look correct? I am setting this in the FEI state.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// Set FCRDIV to 0 so that when the internal fast clock is used it will not&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// be divided down. This will allow us to get to the max frequency of the&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// 4 &lt;SPAN style="text-decoration: underline;"&gt;Mhz&lt;/SPAN&gt; fast clock.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;unsigned&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small;"&gt;char&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; tempRegister = MCG_SC;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;tempRegister &amp;amp;= ~(MCG_SC_FCRDIV_MASK);&lt;/P&gt;&lt;P&gt;tempRegister |= MCG_SC_FCRDIV(0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MCG_SC = tempRegister;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. I am setting the dividers just before entering VLPR mode. MSGCLKOUT should be at 4 Mhz because of the setting of FCRDIV.&amp;nbsp;Does this look correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// The MSGCLKOUT is then divided by SIMDIV of 0, 0, 0, 7.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// 0 = divide by 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// 7 = divide by 8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// Thus, the following rates apply in this situation:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// Core/System = 4Mhz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// Bus = 4Mhz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// &lt;SPAN style="text-decoration: underline;"&gt;Flexbus&lt;/SPAN&gt; = 4Mhz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// Flash = 500Khz // Cannot go over 800 due to security processor &lt;SPAN style="text-decoration: underline;"&gt;errata&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;// see section 6.5.2 VLPR mode clocking in reference manual&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SetSysDividers2( 0, 0, 0, 7 );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 12:08:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/fcrdiv/m-p/623268#M37311</guid>
      <dc:creator>Chris_T</dc:creator>
      <dc:date>2017-02-16T12:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: fcrdiv</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/fcrdiv/m-p/623269#M37312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;The MCG\SIM\OSC module of MK65FN2M0VMI18(on TWR-K65F180M) and MK65FN2M0CAC18 is the same. &lt;BR /&gt;You can refer the code in that exmaple.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="APP_SetClockVlpr.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/16914iFCBD96B53713738B/image-size/large?v=v2&amp;amp;px=999" role="button" title="APP_SetClockVlpr.png" alt="APP_SetClockVlpr.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="CLOCK_SetInternalRefClkConfig.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/16957iF1FDD5B5C0E694BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="CLOCK_SetInternalRefClkConfig.png" alt="CLOCK_SetInternalRefClkConfig.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And have you try to observe the 4MHz MCGIRCLK on CLKOUT pin(PTC3)?&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, 17 Feb 2017 09:29:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/fcrdiv/m-p/623269#M37312</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2017-02-17T09:29:59Z</dc:date>
    </item>
  </channel>
</rss>

