<?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>Kinetis Microcontrollers中的主题 Re: RTC DeInit problem in the example code</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-DeInit-problem-in-the-example-code/m-p/925371#M53900</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;A write to the RTC modulo register is latched until the RTC counter overflows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To avoid the code blocking you can use the RTC interrupt to inform you when it has completed this "parking" of the timer so that it is in its reset state again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;You might like to also try changing the clock source in RTC_SC after setting the module to 0 since it states that doing this will clear both the module and counter, which may then be instantaneous.&lt;/EM&gt;&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;Complete Kinetis solutions for professional needs, training and support: &lt;A href="http://www.utasker.com/kinetis.html" target="test_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;Kinetis KEA128:&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/TRK-KEA128.html" target="test_blank"&gt;http://www.utasker.com/kinetis/TRK-KEA128.html&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KEAZ128Q80.html" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KEAZ128Q80.html&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;uTasker: supporting &amp;gt;1'000 registered Kinetis users get products faster and cheaper to market&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;Request Free emergency remote desk-top consulting at &lt;A href="http://www.utasker.com/services.html" target="test_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;Open Source version at &lt;A href="https://github.com/uTasker/uTasker-Kinetis" target="test_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;&lt;A href="https://community.nxp.com/thread/512558" target="test_blank"&gt;https://community.nxp.com/thread/512558&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 29 Sep 2019 01:19:14 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2019-09-29T01:19:14Z</dc:date>
    <item>
      <title>RTC DeInit problem in the example code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-DeInit-problem-in-the-example-code/m-p/925370#M53899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,everyone!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a problem when I referred to the example code. the codes "while(&lt;SPAN&gt;RTC-&amp;gt;MOD&lt;/SPAN&gt;)" will spend&amp;nbsp;more than 1 second.I use the oscilloscope to observe in my project .Could you help me?&lt;/P&gt;&lt;P&gt;mcu:keazn8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example code:&lt;/P&gt;&lt;P&gt;void RTC_DeInit(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Disable_Interrupt(RTC_IRQn);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;RTC-&amp;gt;MOD = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;while(RTC-&amp;gt;MOD);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;if(RTC_GetFlag())&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RTC_ClrFlags();&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; RTC-&amp;gt;SC = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; while(&lt;SPAN&gt;RTC-&amp;gt;SC&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGS &amp;amp;= ~SIM_SCGC_RTC_MASK;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;void RTC_DeInit(void)&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Disable_Interrupt(RTC_IRQn);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; RTC_MOD = 0;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; while(RTC_MOD);&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if(RTC_SC_RTIF_MASK == (RTC_SC &amp;amp; RTC_SC_RTIF_MASK))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RTC_SC |= RTC_SC_RTIF_MASK;&lt;BR /&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;RTC_SC = 0;&amp;nbsp;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while(RTC_SC);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SIM_SCGC &amp;amp;= ~SIM_SCGC_RTC_MASK;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Sep 2019 12:08:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-DeInit-problem-in-the-example-code/m-p/925370#M53899</guid>
      <dc:creator>fanziyu</dc:creator>
      <dc:date>2019-09-28T12:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: RTC DeInit problem in the example code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-DeInit-problem-in-the-example-code/m-p/925371#M53900</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;A write to the RTC modulo register is latched until the RTC counter overflows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To avoid the code blocking you can use the RTC interrupt to inform you when it has completed this "parking" of the timer so that it is in its reset state again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;You might like to also try changing the clock source in RTC_SC after setting the module to 0 since it states that doing this will clear both the module and counter, which may then be instantaneous.&lt;/EM&gt;&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;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;Complete Kinetis solutions for professional needs, training and support: &lt;A href="http://www.utasker.com/kinetis.html" target="test_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;Kinetis KEA128:&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/TRK-KEA128.html" target="test_blank"&gt;http://www.utasker.com/kinetis/TRK-KEA128.html&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KEAZ128Q80.html" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KEAZ128Q80.html&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;uTasker: supporting &amp;gt;1'000 registered Kinetis users get products faster and cheaper to market&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;Request Free emergency remote desk-top consulting at &lt;A href="http://www.utasker.com/services.html" target="test_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;Open Source version at &lt;A href="https://github.com/uTasker/uTasker-Kinetis" target="test_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;&lt;A href="https://community.nxp.com/thread/512558" target="test_blank"&gt;https://community.nxp.com/thread/512558&lt;/A&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Sep 2019 01:19:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-DeInit-problem-in-the-example-code/m-p/925371#M53900</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-09-29T01:19:14Z</dc:date>
    </item>
  </channel>
</rss>

