<?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: How to configure internal RTC module in MK60FN1M0VLQ12 controller to give time in milli seconds ? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-configure-internal-RTC-module-in-MK60FN1M0VLQ12/m-p/783803#M47718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajkumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RTC_TPR&lt;/STRONG&gt; counts at 32kHz rate so if you read it you can get the time to 30.5us resolution (and x 1000/327628) gives it in ms.&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;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;BR /&gt;Kinetis K60:&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis/TWR-K60N512.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60N512.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis/TWR-K60D100M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60D100M.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis/TWR-K60F120M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60F120M.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis/ELZET80_NET-KBED.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/ELZET80_NET-KBED.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis/ELZET80_NET-K60.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/ELZET80_NET-K60.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/docs/uTasker/uTasker_Time.pdf" rel="nofollow" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTasker_Time.pdf&lt;/A&gt;&lt;SPAN&gt; with complete Gregorian calendar, time zone management, daylight-saving and alarms&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Dec 2018 16:46:16 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2018-12-11T16:46:16Z</dc:date>
    <item>
      <title>How to configure internal RTC module in MK60FN1M0VLQ12 controller to give time in milli seconds ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-configure-internal-RTC-module-in-MK60FN1M0VLQ12/m-p/783802#M47717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Greetings for the day !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on MK60FN1M0VLQ12 controller, enabled the internal RTC with RTC Oscillator operating at 32.768KHz. I am able to get time in seconds resolution but i need to get time with milli seconds.&lt;/P&gt;&lt;P&gt;May you tell how to configure the internal RTC to give time with milliseconds like (HH:MM:SS:ss)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Rajkumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2018 07:22:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-configure-internal-RTC-module-in-MK60FN1M0VLQ12/m-p/783802#M47717</guid>
      <dc:creator>rajkumar_yerraj</dc:creator>
      <dc:date>2018-12-11T07:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure internal RTC module in MK60FN1M0VLQ12 controller to give time in milli seconds ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-configure-internal-RTC-module-in-MK60FN1M0VLQ12/m-p/783803#M47718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajkumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RTC_TPR&lt;/STRONG&gt; counts at 32kHz rate so if you read it you can get the time to 30.5us resolution (and x 1000/327628) gives it in ms.&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;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;BR /&gt;Kinetis K60:&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis/TWR-K60N512.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60N512.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis/TWR-K60D100M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60D100M.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis/TWR-K60F120M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60F120M.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis/ELZET80_NET-KBED.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/ELZET80_NET-KBED.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/kinetis/ELZET80_NET-K60.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/ELZET80_NET-K60.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/www.utasker.com/docs/uTasker/uTasker_Time.pdf" rel="nofollow" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTasker_Time.pdf&lt;/A&gt;&lt;SPAN&gt; with complete Gregorian calendar, time zone management, daylight-saving and alarms&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2018 16:46:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-configure-internal-RTC-module-in-MK60FN1M0VLQ12/m-p/783803#M47718</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-12-11T16:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure internal RTC module in MK60FN1M0VLQ12 controller to give time in milli seconds ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-configure-internal-RTC-module-in-MK60FN1M0VLQ12/m-p/783804#M47719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have read from the RTC_TPR register and it is giving some random value in thousands.&lt;/P&gt;&lt;P&gt;May you help how to read it correctly.&lt;/P&gt;&lt;P&gt;I have attached a screenshot of my code and result. Please check it and let me know how to make it work to read milli seconds.&lt;/P&gt;&lt;P&gt;Value loaded into the TPR register is 0x8000U which is equivalent to 32768 as RTC Oscillator operates on 32.768KHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raj Kumar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2018 15:09:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-configure-internal-RTC-module-in-MK60FN1M0VLQ12/m-p/783804#M47719</guid>
      <dc:creator>rajkumar_yerraj</dc:creator>
      <dc:date>2018-12-19T15:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure internal RTC module in MK60FN1M0VLQ12 controller to give time in milli seconds ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-configure-internal-RTC-module-in-MK60FN1M0VLQ12/m-p/783805#M47720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the uTasker project I can read the date and time with 1ms resolution (here is example output):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;show_time&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;19.12.2018 22:46:41.981&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;show_time&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;19.12.2018 22:46:42.139&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;show_time&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;19.12.2018 22:46:42.446&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;show_time&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;19.12.2018 22:46:42.746&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;show_time&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;19.12.2018 22:46:42.991&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;show_time&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;19.12.2018 22:46:43.229&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;show_time&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;19.12.2018 22:46:43.812&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The (partly pseudo) code to do the time reading is like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FOREVER_LOOP() {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;usTimeStamp = (unsigned short)((RTC_TPR * 1000)/32768);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Now read the RTC time&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;usMSValue = (unsigned short)((RTC_TPR * 1000)/32768);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (usMSValue &amp;gt;= usTimeStamp) {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } // else repeat due to pre-scaler overflow taking place&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;return usMSValue;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice that there is a race state that needs to be avoided, when the pre-scaler overflows between reading it and the second count otherwise there will be a 1s error. The loop ensures that this is caught and the read repeated..&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;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;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2018 23:19:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-configure-internal-RTC-module-in-MK60FN1M0VLQ12/m-p/783805#M47720</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-12-19T23:19:46Z</dc:date>
    </item>
  </channel>
</rss>

