<?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 Kinetis SDK 1.3 RTC Alarm in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Kinetis-SDK-1-3-RTC-Alarm/m-p/545016#M5588</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have initialized a repeat alarm, will using RTC_DRV_SetAlarm set the repeat alarm for the new time? Also will it increment the alarm when it expires?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jason P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jun 2016 17:41:10 GMT</pubDate>
    <dc:creator>jasonphilippi</dc:creator>
    <dc:date>2016-06-17T17:41:10Z</dc:date>
    <item>
      <title>Kinetis SDK 1.3 RTC Alarm</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Kinetis-SDK-1-3-RTC-Alarm/m-p/545016#M5588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have initialized a repeat alarm, will using RTC_DRV_SetAlarm set the repeat alarm for the new time? Also will it increment the alarm when it expires?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jason P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jun 2016 17:41:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Kinetis-SDK-1-3-RTC-Alarm/m-p/545016#M5588</guid>
      <dc:creator>jasonphilippi</dc:creator>
      <dc:date>2016-06-17T17:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis SDK 1.3 RTC Alarm</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Kinetis-SDK-1-3-RTC-Alarm/m-p/545017#M5589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;You cannot just add in that function call to enable repeat alarm operation (or at least I do not think you can).&lt;/P&gt;&lt;P&gt;I took the existing rtc demo from the following path in KSDK_1.3:&lt;/P&gt;&lt;P&gt;C:\Freescale\KSDK_1.3.0\examples\frdmk64f\driver_examples\rtc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I modified it to set up RTC for repeat alarm that will repeat once a minute (currently the repeat alarm configured for resolution of 1 minute or longer time).&lt;/P&gt;&lt;P&gt;The source code is attached (main.c) and all you have to do is change a #define to use default code or use repeat alarm mode:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;#define REPEAT_ALARM_TEST 1&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;//DES 1=repeat alarm test, 0=default code&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 16:15:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Kinetis-SDK-1-3-RTC-Alarm/m-p/545017#M5589</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-06-20T16:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis SDK 1.3 RTC Alarm</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Kinetis-SDK-1-3-RTC-Alarm/m-p/545018#M5590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code you gave addresses how to set up either a repeat alarm or single case alarm. That I do understand.&lt;/P&gt;&lt;P&gt;I want to adjust the alarm in the case I adjust the time due to settings or clock drift.&lt;/P&gt;&lt;P&gt;If I have an alarm going off every 15 minutes, and I find out my time is off forward, I don't want to wait a longer than my repeat alarm time of 15 minutes. Setting the RTC backwards causes a previously set alarm to actually take longer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Repeat alarm and alarm interrupt share an isr function called RTC_DRV_AlarmIntAction, which has a flaw* itself.&lt;/P&gt;&lt;P&gt;Since I have a repeat alarm, it calculates the new alarm time regardless of whether the alarm is a repeat alarm or the new alarm I set. I don't think there are two registers that hold alarm values, then &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;RTC_DRV_SetAlarm should override the old alarm.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jason P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*RTC_DRV_AlarmIntAction had a problem with rollovers of time. Once the time passed the max of each category, it would check if the time was valid in &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;RTC_DRV_SetAlarm. In my case if the time went passed 15 minutes, it would never alarm again. I added two lines to convert back and forth to fix it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_14684436172346327 jive_macro_code jive_text_macro" data-renderedposition="502_8_1192_416" jivemacro_uid="_14684436172346327"&gt;&lt;P&gt;void RTC_DRV_AlarmIntAction(uint32_t instance)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTC_Type *rtcBase = g_rtcBase[instance];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t seconds;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (s_rtcRepeatAlarmState != NULL)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_rtcRepeatAlarmState-&amp;gt;alarmTime.year += s_rtcRepeatAlarmState-&amp;gt;alarmRepTime.year;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_rtcRepeatAlarmState-&amp;gt;alarmTime.month += s_rtcRepeatAlarmState-&amp;gt;alarmRepTime.month;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_rtcRepeatAlarmState-&amp;gt;alarmTime.day += s_rtcRepeatAlarmState-&amp;gt;alarmRepTime.day;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_rtcRepeatAlarmState-&amp;gt;alarmTime.hour += s_rtcRepeatAlarmState-&amp;gt;alarmRepTime.hour;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_rtcRepeatAlarmState-&amp;gt;alarmTime.minute += s_rtcRepeatAlarmState-&amp;gt;alarmRepTime.minute;&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp; RTC_HAL_ConvertDatetimeToSecs(&amp;amp;s_rtcRepeatAlarmState-&amp;gt;alarmTime,&amp;amp;seconds); /*Edit - JRP */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTC_HAL_ConvertSecsToDatetime(&amp;amp;seconds, &amp;amp;s_rtcRepeatAlarmState-&amp;gt;alarmTime); /*Edit - JRP */&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp; RTC_DRV_SetAlarm(instance, &amp;amp;s_rtcRepeatAlarmState-&amp;gt;alarmTime, true);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Writing to the alarm register clears the TAF flag in the Status register */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTC_HAL_SetAlarmReg(rtcBase, 0x0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTC_HAL_SetAlarmIntCmd(rtcBase, false);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 21:09:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Kinetis-SDK-1-3-RTC-Alarm/m-p/545018#M5590</guid>
      <dc:creator>jasonphilippi</dc:creator>
      <dc:date>2016-07-13T21:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis SDK 1.3 RTC Alarm</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Kinetis-SDK-1-3-RTC-Alarm/m-p/545019#M5591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;Thanks for your workaround/fix.&lt;/P&gt;&lt;P&gt;I'll pass to the KSDK team.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 22:07:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Kinetis-SDK-1-3-RTC-Alarm/m-p/545019#M5591</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-07-13T22:07:26Z</dc:date>
    </item>
  </channel>
</rss>

