<?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: K82 : how to identify if RTC initialised already ? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824744#M49865</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;So this is flag&amp;nbsp;kRTC_TimeInvalidFlag in RTC status register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should it be cleaned explicitly when everything is configured or it vanish automatically ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Eugene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Aug 2018 11:04:55 GMT</pubDate>
    <dc:creator>EugeneHiihtaja</dc:creator>
    <dc:date>2018-08-08T11:04:55Z</dc:date>
    <item>
      <title>K82 : how to identify if RTC initialised already ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824736#M49857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SDK examples, RTC is always initialized with some date/time after reboot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But on practice, default time should be set only if RTC is not initialized yet or lost time and etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is correct initialization sequence for enable all what is need and set default time if RTC dosn't have correct time yet ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After some experiments, I can see that&amp;nbsp;&amp;nbsp;kRTC_AlarmFlag is set if RTC dosn't have any initialisation values yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you suggest right sequence what should be executed every time when MCU has SW or HW reset ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have someting like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Init RTC */&lt;/P&gt;&lt;P&gt;rtc_config_t rtcConfig;&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt; * rtcConfig.wakeupSelect = false;&lt;BR /&gt; * rtcConfig.updateMode = false;&lt;BR /&gt; * rtcConfig.supervisorAccess = false;&lt;BR /&gt; * rtcConfig.compensationInterval = 0;&lt;BR /&gt; * rtcConfig.compensationTime = 0;&lt;BR /&gt; */&lt;BR /&gt; RTC_GetDefaultConfig(&amp;amp;rtcConfig);&lt;BR /&gt; RTC_Init(RTC, &amp;amp;rtcConfig);&lt;/P&gt;&lt;P&gt;/* Select RTC clock source, RTC 32KHz oscillator. */&lt;BR /&gt; RTC_SetClockSource(RTC);&lt;/P&gt;&lt;P&gt;/* Start the RTC time counter */&lt;BR /&gt; RTC_StartTimer(RTC);&lt;/P&gt;&lt;P&gt;/* Get RTC status. If it set already. */&lt;BR /&gt; uint32_t status = RTC_GetStatusFlags(RTC);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (status &amp;amp; kRTC_AlarmFlag /*kRTC_TimeInvalidFlag*/)&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;RTC_ClearStatusFlags(RTC, kRTC_AlarmFlag);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;rtc_datetime_t date;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;/* Set a start date time and start RT */&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;date.year = 2018U;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;date.month = 8U;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;date.day = 6U;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;date.hour = 19U;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;date.minute = 0;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;date.second = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* RTC time counter has to be stopped before setting the date &amp;amp; time in the TSR register. */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;RTC_StopTimer(RTC);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/&amp;nbsp;* Set RTC time to default */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;RTC_SetDatetime(RTC, &amp;amp;date);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Start the RTC time counter */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;RTC_StartTimer(RTC);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Eugene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 12:39:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824736#M49857</guid>
      <dc:creator>EugeneHiihtaja</dc:creator>
      <dc:date>2018-08-06T12:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: K82 : how to identify if RTC initialised already ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824737#M49858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eugene,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do you just want to check whether RTC is initialized?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If yes, you just need to compare the register with the reset value.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/79830iAD7B280552966B16/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Actually, if the RTC is configured, and want the RTC to run, you need to enable the RTC_CR_OSCE.&lt;/P&gt;&lt;P&gt;static inline void RTC_SetClockSource(RTC_Type *base)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable the RTC 32KHz oscillator */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; base-&amp;gt;CR |= RTC_CR_OSCE_MASK;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;About the detail initialize flow, you can refer to the SDK RTC project in sdk folder:&lt;/P&gt;&lt;P&gt;FRDM-K82F\boards\frdmk82f\driver_examples\rtc&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 about it, please kindly 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;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>Tue, 07 Aug 2018 06:02:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824737#M49858</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-08-07T06:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: K82 : how to identify if RTC initialised already ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824738#M49859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So initialisation flow after&amp;nbsp; HW/SW reboot can be like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- enable RTC clock source&lt;/P&gt;&lt;P&gt;- read few RTC registers&amp;nbsp; or one for example RTC control register&lt;/P&gt;&lt;P&gt;- if control register has default value -&amp;gt; reinitialize RTC according SDK example ( full flow )&lt;/P&gt;&lt;P&gt;- clean all flags in status register if any&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- RTC is continue to run as usually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what about Time&amp;nbsp;Invalid flag ?&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;Time Invalid Flag&lt;BR /&gt;The time invalid flag is set on VBAT POR or software reset. The TSR and TPR do not increment and read&lt;BR /&gt;as zero when this bit is set. This bit is cleared by writing the TSR register when the time counter is&lt;BR /&gt;disabled.&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;It should indicate software reset and etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Eugene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 06:30:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824738#M49859</guid>
      <dc:creator>EugeneHiihtaja</dc:creator>
      <dc:date>2018-08-07T06:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: K82 : how to identify if RTC initialised already ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824739#M49860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eugene,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; After reset, the TIF in default is 1, it means the time is invalid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you want to enable the time valid, you must write 1 to this bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; After you initialize the RTC, you also need to start timer, then the RTC will run:&lt;/P&gt;&lt;P&gt;&amp;nbsp;RTC_StartTimer(RTC);&lt;/P&gt;&lt;P&gt;&amp;nbsp; The flow, please refer to the SDK rtc project:&lt;/P&gt;&lt;P&gt;RTC_Init();&lt;/P&gt;&lt;P&gt;RTC_SetClockSource(RTC);&lt;/P&gt;&lt;P&gt;RTC_StopTimer(RTC);&lt;/P&gt;&lt;P&gt;RTC_SetDatetime(RTC, &amp;amp;date);&lt;/P&gt;&lt;P&gt;RTC_StartTimer(RTC);&lt;/P&gt;&lt;P&gt;If you want to use interrupt, you also need to enable the interrupt bit, and the NVIC RTC IRQ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&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>Tue, 07 Aug 2018 06:58:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824739#M49860</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-08-07T06:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: K82 : how to identify if RTC initialised already ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824740#M49861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kerry !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see picture is more complicate. Config tool ( I'm using latest MCUEXpresso and SDK ) generate the next function for RTC clock initialization.&lt;/P&gt;&lt;P&gt;And this sequence have effect for my RTC initialization what is executed later on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*FUNCTION**********************************************************************&lt;BR /&gt; *&lt;BR /&gt; * Function Name : CLOCK_CONFIG_SetRtcClock&lt;BR /&gt; * Description : This function is used to configuring RTC clock including &lt;BR /&gt; * enabling RTC oscillator.&lt;BR /&gt; * Param capLoad : RTC oscillator capacity load&lt;BR /&gt; * Param enableOutPeriph : Enable (1U)/Disable (0U) clock to peripherals&lt;BR /&gt; *&lt;BR /&gt; *END**************************************************************************/&lt;BR /&gt;static void CLOCK_CONFIG_SetRtcClock(uint32_t capLoad, uint8_t enableOutPeriph)&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;/* RTC clock gate enable */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;CLOCK_EnableClock(kCLOCK_Rtc0);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if ((RTC-&amp;gt;CR &amp;amp; RTC_CR_OSCE_MASK) == 0u) { /* Only if the Rtc oscillator is not already enabled */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Set the specified capacitor configuration for the RTC oscillator */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RTC_SetOscCapLoad(RTC, capLoad);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Enable the RTC 32KHz oscillator */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RTC-&amp;gt;CR |= RTC_CR_OSCE_MASK;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;/* Output to other peripherals */&lt;BR /&gt; if (enableOutPeriph) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;RTC-&amp;gt;CR &amp;amp;= ~RTC_CR_CLKO_MASK;&lt;BR /&gt; }&lt;BR /&gt; else {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;RTC-&amp;gt;CR |= RTC_CR_CLKO_MASK;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;/* Set the XTAL32/RTC_CLKIN frequency based on board setting. */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;CLOCK_SetXtal32Freq(BOARD_XTAL32K_CLK_HZ);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;/* Set RTC_TSR if there is fault value in RTC */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if (RTC-&amp;gt;SR &amp;amp; RTC_SR_TIF_MASK) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RTC -&amp;gt; TSR = RTC -&amp;gt; TSR;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;/* RTC clock gate disable */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;CLOCK_DisableClock(kCLOCK_Rtc0);&lt;BR /&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;And first power on reset , show 0 status and default time what is in registers&lt;/P&gt;&lt;P&gt;-- RTC ( status 0x0 ) -&amp;gt; 1970-01-01 00:00:00&lt;BR /&gt;-- Power-on Reset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And after SW reset (&amp;nbsp; NVIC_SystemReset() )&amp;nbsp; status is set to 0x4 what means&amp;nbsp;kRTC_AlarmFlag ( ? )&lt;/P&gt;&lt;P&gt;And I configure RTC according SDK example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- RTC ( status 0x4 ) -&amp;gt; 2018-08-08 19:00:00&lt;BR /&gt;-- Software Reset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It means I should just do the next sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Enable RTC clock&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;CLOCK_EnableClock(kCLOCK_Rtc0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Read Year register and if it 1970 ( or less than 2018)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;Execute full initialization sequence , like in SDK example.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Clean RTC status if Alarm is set there.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; Is any glue why it is set over SW reset ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What do you think about this sequence ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Unfortunately it is not part of SDK and we should design it.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Eugene&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 09:56:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824740#M49861</guid>
      <dc:creator>EugeneHiihtaja</dc:creator>
      <dc:date>2018-08-07T09:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: K82 : how to identify if RTC initialised already ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824741#M49862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eugene&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also use the RTC method from the uTasker open source project which is a complete implementation rather than examples as a starting point. You just need to use the relevant content from its &lt;EM&gt;kinetis_RTC.h&lt;/EM&gt; file and the &lt;EM&gt;time_keeper.c&lt;/EM&gt;&lt;SPAN&gt; file which then implements a complete Gregorian calendar method with various alarms, time zone and daylight saving time features: &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%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;P&gt;&lt;/P&gt;&lt;P&gt;Try the K82 simulator too since it emulates the RTC in the chip and allows full testing without need for HW, with more advanced debugging capabilities.&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%2Fkinetis%2FFRDM-K82F.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-K82F.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 14:19:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824741#M49862</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-08-07T14:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: K82 : how to identify if RTC initialised already ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824742#M49863</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;Thank you !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what exact trick is recommended by NXP for identify if RTC running after reboot already and no need to reinitialise all&lt;/P&gt;&lt;P&gt;parameters again ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Eugene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 06:59:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824742#M49863</guid>
      <dc:creator>EugeneHiihtaja</dc:creator>
      <dc:date>2018-08-08T06:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: K82 : how to identify if RTC initialised already ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824743#M49864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eugene&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((RTC_SR &amp;amp; RTC_SR_TIF) != 0) {&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;&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; // if time invalid&lt;/STRONG&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 09:48:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824743#M49864</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-08-08T09:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: K82 : how to identify if RTC initialised already ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824744#M49865</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;So this is flag&amp;nbsp;kRTC_TimeInvalidFlag in RTC status register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should it be cleaned explicitly when everything is configured or it vanish automatically ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Eugene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 11:04:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824744#M49865</guid>
      <dc:creator>EugeneHiihtaja</dc:creator>
      <dc:date>2018-08-08T11:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: K82 : how to identify if RTC initialised already ?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824745#M49866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Eugene&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The flag is cleared when the timer counter is disabled and something is written to RTC_TSR.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/32523i52DD38B16B977A02/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The TIF flag is also explained in the user's manual:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/32569i6B3ADF5BB61D2706/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;however don't get fooled by the note about it being set on a software reset since this actually means the "RTC software reset" command (via RTC_CR) and not a general processor reset.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 21:27:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K82-how-to-identify-if-RTC-initialised-already/m-p/824745#M49866</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-08-08T21:27:04Z</dc:date>
    </item>
  </channel>
</rss>

