<?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 KE04Z  how to set internal oscillator - help needed in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04Z-how-to-set-internal-oscillator-help-needed/m-p/604774#M35608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I'm newbee so please be patient reading my post :-). I have code as below (Which is working properly on FRD-KE04Z) but this development board is using external oscillatror. I have my own simple board based on&amp;nbsp;KE04Z but I need to use internal oscillator. Please help me how to set it up KE04Z to use internal oscillator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main (void)&lt;BR /&gt;{&lt;BR /&gt; RTC_ConfigType sRTCConfig;&lt;BR /&gt; RTC_ConfigType *pRTCConfig = &amp;amp;sRTCConfig; &lt;BR /&gt; /* Perform processor initialization */&lt;BR /&gt; sysinit();&lt;BR /&gt; cpu_identify();&lt;BR /&gt; &lt;BR /&gt; printf("\nLED exaple.\n");&lt;/P&gt;&lt;P&gt;/* configure RTC to 1Hz interrupt frequency */&lt;BR /&gt; pRTCConfig-&amp;gt;u16ModuloValue = 9; &lt;BR /&gt; pRTCConfig-&amp;gt;bInterruptEn = RTC_INTERRUPT_ENABLE; /* enable interrupt */&lt;BR /&gt; pRTCConfig-&amp;gt;bClockSource = RTC_CLKSRC_1KHZ; /*clock source is 1khz*/&lt;BR /&gt; pRTCConfig-&amp;gt;bClockPresaler = RTC_CLK_PRESCALER_100; /*prescaler is 100*/&lt;BR /&gt; &lt;BR /&gt; RTC_SetCallback(RTC_Task);&lt;BR /&gt; RTC_Init(pRTCConfig);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;GPIO_PinInit(GPIO_PTE7, GPIO_PinOutput);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; while (1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void RTC_Task(void)&lt;BR /&gt;{&lt;BR /&gt;GPIO_PinToggle(GPIO_PTE7);&lt;BR /&gt; printf("\nLED state changed.\n");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Oct 2016 11:46:13 GMT</pubDate>
    <dc:creator>macin_nicram</dc:creator>
    <dc:date>2016-10-27T11:46:13Z</dc:date>
    <item>
      <title>KE04Z  how to set internal oscillator - help needed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04Z-how-to-set-internal-oscillator-help-needed/m-p/604774#M35608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I'm newbee so please be patient reading my post :-). I have code as below (Which is working properly on FRD-KE04Z) but this development board is using external oscillatror. I have my own simple board based on&amp;nbsp;KE04Z but I need to use internal oscillator. Please help me how to set it up KE04Z to use internal oscillator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main (void)&lt;BR /&gt;{&lt;BR /&gt; RTC_ConfigType sRTCConfig;&lt;BR /&gt; RTC_ConfigType *pRTCConfig = &amp;amp;sRTCConfig; &lt;BR /&gt; /* Perform processor initialization */&lt;BR /&gt; sysinit();&lt;BR /&gt; cpu_identify();&lt;BR /&gt; &lt;BR /&gt; printf("\nLED exaple.\n");&lt;/P&gt;&lt;P&gt;/* configure RTC to 1Hz interrupt frequency */&lt;BR /&gt; pRTCConfig-&amp;gt;u16ModuloValue = 9; &lt;BR /&gt; pRTCConfig-&amp;gt;bInterruptEn = RTC_INTERRUPT_ENABLE; /* enable interrupt */&lt;BR /&gt; pRTCConfig-&amp;gt;bClockSource = RTC_CLKSRC_1KHZ; /*clock source is 1khz*/&lt;BR /&gt; pRTCConfig-&amp;gt;bClockPresaler = RTC_CLK_PRESCALER_100; /*prescaler is 100*/&lt;BR /&gt; &lt;BR /&gt; RTC_SetCallback(RTC_Task);&lt;BR /&gt; RTC_Init(pRTCConfig);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;GPIO_PinInit(GPIO_PTE7, GPIO_PinOutput);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; while (1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void RTC_Task(void)&lt;BR /&gt;{&lt;BR /&gt;GPIO_PinToggle(GPIO_PTE7);&lt;BR /&gt; printf("\nLED state changed.\n");&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 11:46:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04Z-how-to-set-internal-oscillator-help-needed/m-p/604774#M35608</guid>
      <dc:creator>macin_nicram</dc:creator>
      <dc:date>2016-10-27T11:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: KE04Z  how to set internal oscillator - help needed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04Z-how-to-set-internal-oscillator-help-needed/m-p/604775#M35609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use the KE04 RTC from an internal clock you need to ensure that the code (the generated code possibly doesn't support all cases) does the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ICS_C1 |= (ICS_C1_IRCLKEN | ICS_C1_IREFSTEN); // enable the internal reference clock and allow it to continue running in stop mode&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;RTC_MOD = (((ICSIRCLK)/RTC_CLOCK_PRESCALER_1) - 1); // set the match value for 1s&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;RTC_SC = (RTC_SC_RTIE | RTC_SC_RTIF | _RTC_CLOCK_SOURCE | _RTC_PRESCALER); // clock the RTC from the defined clock source/pre-scaler and enable interrupt&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whereby some of the parameters can be chosen, for example RTC_CLOCK_PRESCALER_1 can be 1,2,4,8,16,32, or 64&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Links below give more details or a complete solution with Gregorian calendar implementation in case you prefer to complete a project optimally that is compatible with all Kinetis parts and be accurately simulated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;BR /&gt;&lt;SPAN&gt;Kinetis for professionals: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fdocs%2FuTasker%2FuTasker_Time.pdf" rel="nofollow" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTasker_Time.pdf&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FKL_RTC.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/KL_RTC.html&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-KE02Z40M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE02Z40M.html&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-KE04Z.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE04Z.html&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-KE06Z.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE06Z.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2016 09:22:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04Z-how-to-set-internal-oscillator-help-needed/m-p/604775#M35609</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2016-10-28T09:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: KE04Z  how to set internal oscillator - help needed</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04Z-how-to-set-internal-oscillator-help-needed/m-p/604776#M35610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcin Goluch,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Welcome to use kineits chip!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you want to use the internal oscillator, you even don't need to configure the clock system.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Because the KE04 is using the the internal oscillator as the default clock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Just modify you code like this:&lt;/P&gt;&lt;P&gt;int main (void)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;unsigned int i;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;GPIO_PinInit(GPIO_PTE7, GPIO_PinOutput);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; while (1){&lt;/P&gt;&lt;P&gt;for(i=0;i&amp;lt;65535;i++);&lt;/P&gt;&lt;P&gt;GPIO_PinToggle(GPIO_PTE7);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try it on your side.&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 style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&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>Fri, 28 Oct 2016 09:37:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KE04Z-how-to-set-internal-oscillator-help-needed/m-p/604776#M35610</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2016-10-28T09:37:03Z</dc:date>
    </item>
  </channel>
</rss>

