<?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: RTC problem with kl46z in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601462#M35296</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;&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%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%2FFRDM-KL46Z.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KL46Z.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%2FTWR-KL46Z48M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-KL46Z48M.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Explications and code for KL46 RTC, including a complete Gregorian calendar implementation, SNTP, alarms, alarm wake-up from very low power mode, summer time and time zone management.&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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Oct 2016 17:08:37 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2016-10-25T17:08:37Z</dc:date>
    <item>
      <title>RTC problem with kl46z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601461#M35295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi every body,&lt;/P&gt;&lt;P&gt;I'am a newbe with my kl46z board and I try to generate an one second interruption with the RTC. Here is the program :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;//test&lt;BR /&gt; MCG_C1 |= MCG_C1_IRCLKEN_MASK;&lt;BR /&gt; MCG_C2 &amp;amp;= ~(MCG_C2_IRCS_MASK);&lt;BR /&gt; //Enable Clock for RTC&lt;BR /&gt; SIM_SCGC6 |= SIM_SCGC6_RTC_MASK;&lt;/P&gt;&lt;P&gt;//Enable interrupt second&lt;BR /&gt; RTC_IER |= 0x10;&lt;BR /&gt; RTC_IER &amp;amp;= 0xfffffff8;&lt;BR /&gt; NVIC_EnableIRQ(21);&lt;BR /&gt; //Chose Clk OSC32KCLK&lt;BR /&gt; SIM_SOPT1 |= 0x00000000;&lt;/P&gt;&lt;P&gt;//ENable OSCE&lt;BR /&gt; RTC_CR |= 0x100;&lt;/P&gt;&lt;P&gt;//To clear the Time invalid Flag&lt;BR /&gt; RTC_TSR =0x01;&lt;BR /&gt; //Enable RTC&lt;BR /&gt; RTC_SR |= 0x10;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But at the end I never go to interruption. If you have any idea that could help me please ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2016 13:59:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601461#M35295</guid>
      <dc:creator>floridjam</dc:creator>
      <dc:date>2016-10-25T13:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: RTC problem with kl46z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601462#M35296</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;&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%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%2FFRDM-KL46Z.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KL46Z.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%2FTWR-KL46Z48M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-KL46Z48M.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Explications and code for KL46 RTC, including a complete Gregorian calendar implementation, SNTP, alarms, alarm wake-up from very low power mode, summer time and time zone management.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2016 17:08:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601462#M35296</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2016-10-25T17:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: RTC problem with kl46z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601463#M35297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Florian,&lt;/P&gt;&lt;P&gt;According to your last Question, it seems that you are using FRDM-KL46Z freedom board.&lt;/P&gt;&lt;P&gt;The RTC module has three clock sources.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="RTC clock generation.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/6499i22F3386AD76A552F/image-size/large?v=v2&amp;amp;px=999" role="button" title="RTC clock generation.png" alt="RTC clock generation.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This board has a 8MHz crystal connected on System oscillator, but 8MHz OSC32KCLK can't be used for RTC.&lt;/P&gt;&lt;P&gt;And there is no 32kHz clock source connected on RTC_CLKIN.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="FRDM-KL46Z RTC clock source.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/6457i90BE51B7FD420EBD/image-size/large?v=v2&amp;amp;px=999" role="button" title="FRDM-KL46Z RTC clock source.png" alt="FRDM-KL46Z RTC clock source.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to evaluation RTC second interrupt on FRDM-KL46Z, you may have to select internal 1kHz LPO as the clock source of RTC. Due to the lower frequency of clock source, The RTC second interrupt may happen every 32s.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="internal 1kHz LPO.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/6584i87489AE2DA6895DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="internal 1kHz LPO.png" alt="internal 1kHz LPO.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 02:18:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601463#M35297</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2016-10-26T02:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: RTC problem with kl46z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601464#M35298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes ! It work with the LPO. But now how can I manage to have a 1s interruption instead of every 32 seconds. May be I should use a timer to do so ?&lt;/P&gt;&lt;P&gt;Anyway thanks a lot for your answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 09:06:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601464#M35298</guid>
      <dc:creator>floridjam</dc:creator>
      <dc:date>2016-10-26T09:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: RTC problem with kl46z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601465#M35299</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;The following is the code to allow the LPO to be used as 1s interrupt:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTC_SR = 0;&amp;nbsp; // temporarily disable RTC to avoid potential interrupt&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTC_TPR = (32768 - 1000);&amp;nbsp; // use 1kHz internal clock to generate 1s time base by adjusting the prescaler value&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTC_SR = RTC_SR_TCE;&amp;nbsp; // enable counter again&lt;/P&gt;&lt;P&gt;It needs to be performed when starting and at each 1s interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note however that the LPO is not very accurate and so will tend to get up to 1 minute drift every hour. If you have a real-world RTC requirement you usually need to use a 32kHz oscillator.&lt;BR /&gt;Also the LPO will cause the RTC to be 32x too slow when the chip is in the very low power mode and so any alarms etc. will be inaccurate unless compensated for in the software solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the uTasker RTC module as reference (for all chips, including KLs) which also solves KL RTC with LPO source with regards to keeping time in standby modes and with regards to low power wake up alarms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Mark&lt;BR /&gt;Kinetis for professionals: &lt;A href="http://www.utasker.com/kinetis.html"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 15:03:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601465#M35299</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2016-10-26T15:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: RTC problem with kl46z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601466#M35300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Mark.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 17:51:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-problem-with-kl46z/m-p/601466#M35300</guid>
      <dc:creator>floridjam</dc:creator>
      <dc:date>2016-10-26T17:51:22Z</dc:date>
    </item>
  </channel>
</rss>

