<?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: FRDMKL02Z Clock configuration in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468613#M28293</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andres,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sorry for the 10 seconds, if you use the 10ms, you should define it like this:&lt;/P&gt;&lt;P&gt;#defind HWRIMER_PERIOD&amp;nbsp; 10000&lt;/P&gt;&lt;P&gt;&amp;nbsp; Because the default period unit is us, you can't define it as 10.&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you never modify the KSDK code, the core is 47972352U, just as mario has told you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;If you still have question, please contact me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jingjing&lt;/P&gt;&lt;P&gt;&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>Tue, 26 Apr 2016 01:59:36 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2016-04-26T01:59:36Z</dc:date>
    <item>
      <title>FRDMKL02Z Clock configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468609#M28289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone, I hope you can help me to solve my doubts.&amp;nbsp; They are silly doubts for you, for sure, but I started with the kinetis MCU some weeks ago and I don't know how to change it yet.&lt;/P&gt;&lt;P&gt;This is my case, I have a FRDMKL02Z kit and IAR as software development tool. I would like to change the &lt;STRONG&gt;clock configuration&lt;/STRONG&gt; of my project.&lt;/P&gt;&lt;P&gt;I started with the "&lt;STRONG&gt;Hardware Timer Demo&lt;/STRONG&gt;" example supplied by NXP, I have seen the NXP documentation and I know there are two different clock modules (MCG and OSC) and so on. But in the practical way I wanted to change my program for another clock configuration (&lt;STRONG&gt;I would like to have an interrupt every 10 microseconds and also enough time for signal processing between interrupts happen, if possible&lt;/STRONG&gt;). &lt;/P&gt;&lt;P&gt;There is a "BOARD_ClockInit" function and also a "BOARD_InitOsc0" function to configure the OSC module, &lt;STRONG&gt;but how can I change these functions to configure this demo example for a desired frequency?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2016 11:21:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468609#M28289</guid>
      <dc:creator>albt</dc:creator>
      <dc:date>2016-04-22T11:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: FRDMKL02Z Clock configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468610#M28290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andres,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Did you run this code:C:\Freescale\KSDK_1.3.0\examples\frdmkl02z\demo_apps\hwtimer_demo\iar ?&lt;/P&gt;&lt;P&gt;&amp;nbsp; This code is using the systick hardware timer, the max interrupt period is about 5.59s, when core is 48Mhz, and&amp;nbsp; divide-by-16 of the core clock as the systick clock source, as you know, systick is a 24bit timer.&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you want to get the 10s period, you can configure the HWTIMER_PERIOD = 5000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;#define HWTIMER_PERIOD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;5000000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp; Then, the interrupt will enter in every 5 seconds, you can count the interrupt times.&lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_14615546418492384 jive_macro_code jive_text_macro" data-renderedposition="251_8_1192_400" jivemacro_uid="_14615546418492384"&gt;&lt;P&gt;volatile unsigned char hwcnt=0;&lt;/P&gt;&lt;P&gt;void hwtimer_callback(void* data)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; // PRINTF(".");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((HWTIMER_SYS_GetTicks(&amp;amp;hwtimer) % HWTIMER_DOTS_PER_LINE) == 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("\r\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((HWTIMER_SYS_GetTicks(&amp;amp;hwtimer) % (HWTIMER_LINES_COUNT * HWTIMER_DOTS_PER_LINE)) == 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (kHwtimerSuccess != HWTIMER_SYS_Stop(&amp;amp;hwtimer))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("\r\nError: hwtimer stop.\r\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("End\r\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hwcnt++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if((hwcnt) == 2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hwcnt=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF(".");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;When hwcnt=2, it means, the 10s is reached, and it will printf a point.&lt;/P&gt;&lt;P&gt;You can try it.&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;If you still have question, please let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jingjing&lt;/P&gt;&lt;P&gt;&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>Mon, 25 Apr 2016 03:25:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468610#M28290</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-04-25T03:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: FRDMKL02Z Clock configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468611#M28291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;Jingjing,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your time and help. &lt;/P&gt;&lt;P&gt;Answering to your first question, YES, I have run the hwtimer_demo code. But in my case, I want a timer interrupt period of 10 &lt;STRONG&gt;micro&lt;/STRONG&gt;seconds (NOT 10 seconds), so I configure the &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;HWTIMER_PERIOD = 10:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE style="border: 0px; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding: 2px 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;#define HWTIMER_PERIOD&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD style="padding: 2px 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Although I configure the HWTIMER_PERIOD = 10, it seems the interrupt does not occur at 10 microseconds, but I will try to understand it later, but my first issue is that I have used the default configuration of the hwtimer_demo example (I don't know if 48 Mhz core clock). &lt;STRONG&gt;How or in which function can I verify and/or change the clock configuration?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help Jingjing. I hope you can guide me on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 08:26:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468611#M28291</guid>
      <dc:creator>albt</dc:creator>
      <dc:date>2016-04-25T08:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: FRDMKL02Z Clock configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468612#M28292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andres&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;The function &lt;STRONG&gt;BOARD_InitOsc0&lt;/STRONG&gt; is only configuring the system oscillator. OSC frequency, MCG range, enable capacitor. You have an external OSC and the frequency is 32.768 KHz.&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14616072147233165" data-renderedposition="112_8_1155_193" jivemacro_uid="_14616072147233165" modifiedtitle="true"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// OSC0 configuration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #005032;"&gt;osc_user_config_t&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; osc0Config =&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .freq&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = OSC0_XTAL_FREQ,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .hgo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = MCG_HGO0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .range&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = MCG_RANGE0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .erefs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = MCG_EREFS0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .enableCapacitor2p&amp;nbsp;&amp;nbsp; = OSC0_SC2P_ENABLE_CONFIG,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .enableCapacitor4p&amp;nbsp;&amp;nbsp; = OSC0_SC4P_ENABLE_CONFIG,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .enableCapacitor8p&amp;nbsp;&amp;nbsp; = OSC0_SC8P_ENABLE_CONFIG,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .enableCapacitor16p&amp;nbsp; = OSC0_SC16P_ENABLE_CONFIG,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Capture1.PNG"&gt;&lt;IMG alt="Capture1.PNG" src="https://community.nxp.com/t5/image/serverpage/image-id/35050iA71805CE162E8A5B/image-size/large?v=v2&amp;amp;px=999" title="Capture1.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Now you have the frequency of the OSC and you will selected the configuration for the different states of the MCG.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CLOCK_SetBootConfig(&amp;amp;g_defaultClockConfigRun);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The next structure shows the configuration for enter run mode&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14616072455324406" data-renderedposition="562.5_8_1155_385" jivemacro_uid="_14616072455324406" modifiedtitle="true"&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; font-family: Consolas;"&gt;const&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #005032;"&gt;clock_manager_user_config_t&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; &lt;SPAN style="background: yellow;"&gt;g_defaultClockConfigRun&lt;/SPAN&gt; =&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .mcgConfig =&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .mcg_mode&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;/SPAN&gt;&lt;EM style="color: #0000c0; font-size: 10.0pt; font-family: Consolas;"&gt;kMcgModeFEE&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// Work in FEE mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .irclkEnable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = true,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// MCGIRCLK enable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .irclkEnableInStop&amp;nbsp; = false,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// MCGIRCLK disable in STOP mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .ircs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;/SPAN&gt;&lt;EM style="color: #0000c0; font-size: 10.0pt; font-family: Consolas;"&gt;kMcgIrcSlow&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// Select IRC32k.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .fcrdiv&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0U,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// FCRDIV is 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .frdiv&amp;nbsp; = 0U,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .drs&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;/SPAN&gt;&lt;EM style="color: #0000c0; font-size: 10.0pt; font-family: Consolas;"&gt;kMcgDcoRangeSelMid&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// Mid frequency range&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .dmx32&amp;nbsp; = &lt;/SPAN&gt;&lt;EM style="color: #0000c0; font-size: 10.0pt; font-family: Consolas;"&gt;kMcgDmx32Fine&lt;/EM&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// DCO has a default range of 25%&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; },&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .simConfig =&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .outdiv1&amp;nbsp; = 0U,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .outdiv4&amp;nbsp; = 1U,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; },&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .oscerConfig =&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .enable&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = true,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// OSCERCLK enable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; .enableInStop = false,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;// OSCERCLK disable in STOP mode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;As you can see the mcg configuration is working in FEE mode, and selecting the&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;OSCCLK. If you want&amp;nbsp; to know or to modify the frequency, you should modified the values of drs and dmx. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;The select values are drs = 1 (kMcgDcoRangeSelMid ) and dmx32 = 1 (kMcgDmx32Fine) and with this you have a frequency of 48MHz. The core is working with 48MHz. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;DCO RANGE = 1464 * 32.768KHz =&amp;nbsp; 47.972352 Mhz.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"&gt;&lt;IMG alt="Capture.PNG" src="https://community.nxp.com/t5/image/serverpage/image-id/35137i1C6E744345694E38/image-size/large?v=v2&amp;amp;px=999" title="Capture.PNG" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;If you have problems with the frequency of MGC let me know&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;Have a great day&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt;Mario&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:24:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468612#M28292</guid>
      <dc:creator>mario_castaneda</dc:creator>
      <dc:date>2020-11-02T13:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: FRDMKL02Z Clock configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468613#M28293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andres,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sorry for the 10 seconds, if you use the 10ms, you should define it like this:&lt;/P&gt;&lt;P&gt;#defind HWRIMER_PERIOD&amp;nbsp; 10000&lt;/P&gt;&lt;P&gt;&amp;nbsp; Because the default period unit is us, you can't define it as 10.&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you never modify the KSDK code, the core is 47972352U, just as mario has told you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;If you still have question, please contact me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jingjing&lt;/P&gt;&lt;P&gt;&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>Tue, 26 Apr 2016 01:59:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468613#M28293</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-04-26T01:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: FRDMKL02Z Clock configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468614#M28294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Mario. It has been very helpful for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andres. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 06:26:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468614#M28294</guid>
      <dc:creator>albt</dc:creator>
      <dc:date>2016-04-26T06:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: FRDMKL02Z Clock configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468615#M28295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your support Jingjing. Fortunatelly I just fix the problem, and I understand it better with Mario explanations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day.&lt;/P&gt;&lt;P&gt;Andres.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 06:30:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDMKL02Z-Clock-configuration/m-p/468615#M28295</guid>
      <dc:creator>albt</dc:creator>
      <dc:date>2016-04-26T06:30:22Z</dc:date>
    </item>
  </channel>
</rss>

