<?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 time counter doesn't work on K64</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-time-counter-doesn-t-work-on-K64/m-p/1383455#M62017</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/190340"&gt;@nxf77486&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you for your answer.&amp;nbsp;&lt;SPAN&gt;RTC_CR_OSCE is well set to "1". I verified&amp;nbsp;SR[TOF] and&amp;nbsp;SR[TIF] bits and they are set to "0". Then the time counter should increment this value but it's not the case. The RTC_TSR counter stay always at the same value which is set at the beginning by&amp;nbsp;RTC_SetDatetime().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is the setup of my oscillator (It’s automaticaly genereted when I setup the clock sources) :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  /* RTC clock gate enable */
  CLOCK_EnableClock(kCLOCK_Rtc0);
  if ((RTC-&amp;gt;CR &amp;amp; RTC_CR_OSCE_MASK) == 0u) { /* Only if the Rtc oscillator is not already enabled */
    /* Set the specified capacitor configuration for the RTC oscillator */
    RTC_SetOscCapLoad(RTC, capLoad);
    /* Enable the RTC 32KHz oscillator */
    RTC-&amp;gt;CR |= RTC_CR_OSCE_MASK;
  }
  /* Output to other peripherals */
  if (enableOutPeriph) {
    RTC-&amp;gt;CR &amp;amp;= ~RTC_CR_CLKO_MASK;
  }
  else {
    RTC-&amp;gt;CR |= RTC_CR_CLKO_MASK;
  }
  /* Set the XTAL32/RTC_CLKIN frequency based on board setting. */
  CLOCK_SetXtal32Freq(BOARD_XTAL32K_CLK_HZ);
  /* Set RTC_TSR if there is fault value in RTC */
  if (RTC-&amp;gt;SR &amp;amp; RTC_SR_TIF_MASK) {
    RTC -&amp;gt; TSR = RTC -&amp;gt; TSR;
  }
  /* RTC clock gate disable */
  CLOCK_DisableClock(kCLOCK_Rtc0);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And it’s call in my main() by :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;BOARD_InitBootClocks();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You will find below my RTC hardware configuration, I use VBAT too :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mota_0-1638970589890.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/164518iE134B541D7DCCB78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mota_0-1638970589890.png" alt="Mota_0-1638970589890.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don’t have FRDM-K64 board to test these kind of examples and I’m working with a MK64FX512xxx12 instead of MK64FN1M0xxx12.&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mota&lt;/P&gt;</description>
    <pubDate>Wed, 08 Dec 2021 13:44:21 GMT</pubDate>
    <dc:creator>Mota</dc:creator>
    <dc:date>2021-12-08T13:44:21Z</dc:date>
    <item>
      <title>RTC time counter doesn't work on K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-time-counter-doesn-t-work-on-K64/m-p/1381912#M61996</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I'm working with a RTC peripheral on K64 with external 32,768Khz clock and the time counter doesn't seem to work. In other words, the&amp;nbsp;RTC-&amp;gt;TSR content stay the same. I verified on the XTAL output and the oscillator is working correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is my init :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;rtc_config_t RTC_config = {
.wakeupSelect = false,
.updateMode = false,
.supervisorAccess = false,
.compensationInterval = 0x0U,
.compensationTime = 0x0U
};

dateTime_st.u16Year = 2021;
dateTime_st.u8Month = 11;
dateTime_st.u8Day = 24;
dateTime_st.u8Hour = 8;
dateTime_st.u8Min = 54;
dateTime_st.u8Sec = 00;

/* RTC initialization */
RTC_Init(RTC, &amp;amp;RTC_config);

/* Select RTC clock source */
RTC_SetClockSource(RTC); // Same as : RTC-&amp;gt;CR |= RTC_CR_OSCE_MASK;

/* Stop RTC timer */
RTC_StopTimer(RTC); // Same as : RTC-&amp;gt;SR |= ~RTC_SR_TCE_MASK;

/* Date and time initialization */
RTC_SetDatetime(RTC, (rtc_datetime_t *) &amp;amp;dateTime_st);

/* Start RTC timer */
RTC_StartTimer(RTC); // Same as : RTC-&amp;gt;SR |= RTC_SR_TCE_MASK;&lt;/LI-CODE&gt;&lt;P&gt;My clock sources and diagram configuration :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mota_0-1638788125160.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/164199iBD79F23C643CC359/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mota_0-1638788125160.png" alt="Mota_0-1638788125160.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any idea ?&lt;/P&gt;&lt;P&gt;Thank you by advance.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;Mota&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 11:24:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-time-counter-doesn-t-work-on-K64/m-p/1381912#M61996</guid>
      <dc:creator>Mota</dc:creator>
      <dc:date>2021-12-06T11:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: RTC time counter doesn't work on K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-time-counter-doesn-t-work-on-K64/m-p/1382838#M62008</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194397"&gt;@Mota&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for your information I understand that your HW 32kHZ crystal is fine. Can you please check the RTC oscillator initialization that something has not been missing like the RTC_CR_OSCE bit (check if this is being set 1).&lt;/P&gt;
&lt;P&gt;I also due recommend to try one of the SDK examples for the RTC.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 19:20:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-time-counter-doesn-t-work-on-K64/m-p/1382838#M62008</guid>
      <dc:creator>nxf77486</dc:creator>
      <dc:date>2021-12-07T19:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: RTC time counter doesn't work on K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-time-counter-doesn-t-work-on-K64/m-p/1383455#M62017</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/190340"&gt;@nxf77486&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you for your answer.&amp;nbsp;&lt;SPAN&gt;RTC_CR_OSCE is well set to "1". I verified&amp;nbsp;SR[TOF] and&amp;nbsp;SR[TIF] bits and they are set to "0". Then the time counter should increment this value but it's not the case. The RTC_TSR counter stay always at the same value which is set at the beginning by&amp;nbsp;RTC_SetDatetime().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is the setup of my oscillator (It’s automaticaly genereted when I setup the clock sources) :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  /* RTC clock gate enable */
  CLOCK_EnableClock(kCLOCK_Rtc0);
  if ((RTC-&amp;gt;CR &amp;amp; RTC_CR_OSCE_MASK) == 0u) { /* Only if the Rtc oscillator is not already enabled */
    /* Set the specified capacitor configuration for the RTC oscillator */
    RTC_SetOscCapLoad(RTC, capLoad);
    /* Enable the RTC 32KHz oscillator */
    RTC-&amp;gt;CR |= RTC_CR_OSCE_MASK;
  }
  /* Output to other peripherals */
  if (enableOutPeriph) {
    RTC-&amp;gt;CR &amp;amp;= ~RTC_CR_CLKO_MASK;
  }
  else {
    RTC-&amp;gt;CR |= RTC_CR_CLKO_MASK;
  }
  /* Set the XTAL32/RTC_CLKIN frequency based on board setting. */
  CLOCK_SetXtal32Freq(BOARD_XTAL32K_CLK_HZ);
  /* Set RTC_TSR if there is fault value in RTC */
  if (RTC-&amp;gt;SR &amp;amp; RTC_SR_TIF_MASK) {
    RTC -&amp;gt; TSR = RTC -&amp;gt; TSR;
  }
  /* RTC clock gate disable */
  CLOCK_DisableClock(kCLOCK_Rtc0);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And it’s call in my main() by :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;BOARD_InitBootClocks();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You will find below my RTC hardware configuration, I use VBAT too :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mota_0-1638970589890.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/164518iE134B541D7DCCB78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mota_0-1638970589890.png" alt="Mota_0-1638970589890.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don’t have FRDM-K64 board to test these kind of examples and I’m working with a MK64FX512xxx12 instead of MK64FN1M0xxx12.&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mota&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 13:44:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-time-counter-doesn-t-work-on-K64/m-p/1383455#M62017</guid>
      <dc:creator>Mota</dc:creator>
      <dc:date>2021-12-08T13:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: RTC time counter doesn't work on K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-time-counter-doesn-t-work-on-K64/m-p/1383560#M62019</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194397"&gt;@Mota&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe this could still be related with the RTC configuration.&lt;/P&gt;
&lt;P&gt;I understand you are using a MK64FX512xxx12, but the RTC examples for the FRDM-K64 still a good reference for your project they still the same module.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SDK FRDM-K64&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A title="FRDM-K64F" href="https://mcuxpresso.nxp.com/en/builder?hw=FRDM-K64F" target="_blank" rel="noopener"&gt;FRDM-K64F&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 19:24:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-time-counter-doesn-t-work-on-K64/m-p/1383560#M62019</guid>
      <dc:creator>nxf77486</dc:creator>
      <dc:date>2021-12-08T19:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: RTC time counter doesn't work on K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-time-counter-doesn-t-work-on-K64/m-p/1383885#M62035</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/190340"&gt;@nxf77486&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Ok I'll research in the RTC configuration first. Thank you for these examples. I let you know.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mota&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 08:46:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/RTC-time-counter-doesn-t-work-on-K64/m-p/1383885#M62035</guid>
      <dc:creator>Mota</dc:creator>
      <dc:date>2021-12-09T08:46:28Z</dc:date>
    </item>
  </channel>
</rss>

