<?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: MCXN547: how to enable iRTC subSecond function ? in MCX Microcontrollers</title>
    <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2186427#M4214</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/69183"&gt;@jimmyli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tested again.&lt;/P&gt;
&lt;P&gt;By default, the RTC Clock select&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* 16.384kHz clock is selected */&lt;BR /&gt;config-&amp;gt;clockSelect = kIRTC_Clk16K;&lt;/P&gt;
&lt;P&gt;So the count should less than 16384&lt;/P&gt;
&lt;P&gt;You just need to change&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RTC-&amp;gt;CTRL |= RTC_CTRL_CLKOUT((uint16_t)kIRTC_ClkoutFine1Hz);&lt;/P&gt;
&lt;P&gt;to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IRTC_ConfigClockOut(RTC, kIRTC_ClkoutCoarse1Hz);&lt;/P&gt;
&lt;P&gt;It can work.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Harry_Zhang_0-1760515151613.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360855i27C1A6C909E512DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Harry_Zhang_0-1760515151613.png" alt="Harry_Zhang_0-1760515151613.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
    <pubDate>Wed, 15 Oct 2025 08:07:20 GMT</pubDate>
    <dc:creator>Harry_Zhang</dc:creator>
    <dc:date>2025-10-15T08:07:20Z</dc:date>
    <item>
      <title>MCXN547: how to enable iRTC subSecond function ?</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2182747#M4159</link>
      <description>&lt;P&gt;Hi NXP,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I find that MCXN547 has subsecond function register for iRTC, and I consider using this function to record millisecond.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; According to official SDK (SDK_2.x_FRDM-MCXN947), I import the iRTC driver example and add the code to test this function, but failed.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Can you help to check and provide some tips ?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Thanks;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;gt;subSecond register in MCXN reference manual&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimmyli_0-1759989461232.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360005iE066F39F17058C7F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimmyli_0-1759989461232.png" alt="jimmyli_0-1759989461232.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;gt;test code&lt;/P&gt;&lt;P&gt;based on example:&lt;FONT color="#FF0000"&gt;&amp;nbsp;frdmmcxn947_irtc_cm33_core0&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;hardware: &lt;FONT color="#FF0000"&gt;FRDM-MCXN947&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;IRTC_EnableSubsecondCounter(RTC,true);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN&gt; subSecond_cnt = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt;(1){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;subSecond_cnt = IRTC_GetSubsecondCount(RTC);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PRINTF(&lt;/SPAN&gt;&lt;SPAN&gt;"subSecond Counter is %d.\r\n"&lt;/SPAN&gt;&lt;SPAN&gt;,subSecond_cnt);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;//intervals time&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN&gt; i,j;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt;(i=0;i&amp;lt;6534;i++)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt;(j=0;j&amp;lt;6232;j++){&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;__NOP();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimmyli_1-1759989578566.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360006i5263BC5CA8F748CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimmyli_1-1759989578566.png" alt="jimmyli_1-1759989578566.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;3&amp;gt;test result&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; the parameter "&lt;SPAN&gt;subSecond_cnt" is still 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 06:16:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2182747#M4159</guid>
      <dc:creator>jimmyli</dc:creator>
      <dc:date>2025-10-09T06:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN547: how to enable iRTC subSecond function ?</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2183463#M4170</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/69183"&gt;@jimmyli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Subsecond counter&amp;nbsp; use these register, not RTC_TEST2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Harry_Zhang_0-1760064450831.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360160iA963611669BD6EFB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Harry_Zhang_0-1760064450831.png" alt="Harry_Zhang_0-1760064450831.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you want to use is,&lt;/P&gt;
&lt;P&gt;Please refer to&amp;nbsp; chapter&amp;nbsp;56.3.2 Subsecond counter&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Harry_Zhang_1-1760064593090.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360161i5720779C7A01A394/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Harry_Zhang_1-1760064593090.png" alt="Harry_Zhang_1-1760064593090.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can try.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2025 02:50:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2183463#M4170</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2025-10-10T02:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN547: how to enable iRTC subSecond function ?</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2183479#M4171</link>
      <description>&lt;P&gt;Hi Harry,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Yes, you are right, the subsecond function has its own register.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;But, I called the&amp;nbsp;&lt;STRONG&gt;static inline void IRTC_EnableSubsecondCounter(RTC_Type *base, bool enable) &lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;static inline uint32_t IRTC_GetSubsecondCount(RTC_Type *base) &lt;/STRONG&gt;APIs in &lt;FONT color="#FF0000"&gt;fsl_irtc.h&lt;/FONT&gt; to enable and read the subsecond counter, but failed.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Do you have any tips to help to enable this function ?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thanks very much.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2025 03:06:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2183479#M4171</guid>
      <dc:creator>jimmyli</dc:creator>
      <dc:date>2025-10-10T03:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN547: how to enable iRTC subSecond function ?</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2183668#M4177</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/69183"&gt;@jimmyli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just tested it on my end.&lt;/P&gt;
&lt;P&gt;It can work.&lt;/P&gt;
&lt;P&gt;According to the RM.&lt;/P&gt;
&lt;P&gt;There are two important points to note.&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp;You must independently enable the field by writing 1 to SUBSECOND_CTRL[SUB_SECOND_CNT_EN] after &lt;STRONG&gt;enabling RTC.CTRL[CLKOUT]&lt;/STRONG&gt; (see chip-specific RTC_SUBSYSTEM for more information) to &lt;STRONG&gt;select the 1 Hz clock output.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;2.In RTC.CTRL[CLKO_DIS]&amp;nbsp; you should select&amp;nbsp;The selected clock is output to other peripherals. 0b&lt;/P&gt;
&lt;P&gt;This is my test code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    IRTC_GetDefaultConfig(&amp;amp;irtcConfig);
    irtcConfig.disableClockOutput = false;
    if (IRTC_Init(RTC, &amp;amp;irtcConfig) == kStatus_Fail)
    {
        return 1;
    }
    
    PRINTF("RTC Example START:\r\n");

    RTC-&amp;gt;CTRL &amp;amp;= (uint16_t)(~RTC_CTRL_CLKOUT_MASK);

    RTC-&amp;gt;CTRL |= RTC_CTRL_CLKOUT((uint16_t)kIRTC_ClkoutFine1Hz);

    IRTC_EnableSubsecondCounter(RTC, true);

    uint32_t subSecond_cnt = 0;

    while(1){

    subSecond_cnt = IRTC_GetSubsecondCount(RTC);

    PRINTF("subSecond Counter is %d.\r\n",subSecond_cnt);


    //intervals time

    uint32_t i,j;

    for(i=0;i&amp;lt;6534;i++)

    for(j=0;j&amp;lt;6232;j++){

    __NOP();

    }
    }
    for (;;)
    {
    }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Harry_Zhang_0-1760082383619.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360213i8E2441CB485C0D8E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Harry_Zhang_0-1760082383619.png" alt="Harry_Zhang_0-1760082383619.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2025 07:46:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2183668#M4177</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2025-10-10T07:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN547: how to enable iRTC subSecond function ?</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2183755#M4180</link>
      <description>&lt;P&gt;Hi Harry,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Thanks very much for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I have checked with your code, and subsecond can work now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; But I have a question that when I convert subsecond counter to minisecond, the value seems wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Eg: 1&amp;gt;default clock source for subsecond counter is 32KHz;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;gt;Minisecond Value = ( 1 / 32KHz ) * subsecond counter = 1/32000 x 53479 = 1.67 (s) &amp;gt; 1(s)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Do I calculate it wrongly ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimmyli_0-1760086905182.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360232i3E57B86A351E478F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimmyli_0-1760086905182.png" alt="jimmyli_0-1760086905182.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2025 09:02:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2183755#M4180</guid>
      <dc:creator>jimmyli</dc:creator>
      <dc:date>2025-10-10T09:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN547: how to enable iRTC subSecond function ?</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2185642#M4205</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/69183"&gt;@jimmyli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think your calculation method is correct,&lt;/P&gt;
&lt;P&gt;So i need to confirm with the internal team.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2025 10:10:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2185642#M4205</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2025-10-14T10:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN547: how to enable iRTC subSecond function ?</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2186427#M4214</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/69183"&gt;@jimmyli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tested again.&lt;/P&gt;
&lt;P&gt;By default, the RTC Clock select&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* 16.384kHz clock is selected */&lt;BR /&gt;config-&amp;gt;clockSelect = kIRTC_Clk16K;&lt;/P&gt;
&lt;P&gt;So the count should less than 16384&lt;/P&gt;
&lt;P&gt;You just need to change&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RTC-&amp;gt;CTRL |= RTC_CTRL_CLKOUT((uint16_t)kIRTC_ClkoutFine1Hz);&lt;/P&gt;
&lt;P&gt;to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IRTC_ConfigClockOut(RTC, kIRTC_ClkoutCoarse1Hz);&lt;/P&gt;
&lt;P&gt;It can work.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Harry_Zhang_0-1760515151613.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/360855i27C1A6C909E512DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Harry_Zhang_0-1760515151613.png" alt="Harry_Zhang_0-1760515151613.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2025 08:07:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2186427#M4214</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2025-10-15T08:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN547: how to enable iRTC subSecond function ?</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2186700#M4216</link>
      <description>&lt;P&gt;Hi Harry,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Got it.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Thanks very much.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2025 14:07:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2186700#M4216</guid>
      <dc:creator>jimmyli</dc:creator>
      <dc:date>2025-10-15T14:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN547: how to enable iRTC subSecond function ?</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2186834#M4217</link>
      <description>&lt;P&gt;yes thanks&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2025 17:50:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN547-how-to-enable-iRTC-subSecond-function/m-p/2186834#M4217</guid>
      <dc:creator>lucindaschatz</dc:creator>
      <dc:date>2025-10-15T17:50:12Z</dc:date>
    </item>
  </channel>
</rss>

