<?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>Power ManagementのトピックSBC FS65 - Cannot use the LDT Timer twice in a row</title>
    <link>https://community.nxp.com/t5/Power-Management/SBC-FS65-Cannot-use-the-LDT-Timer-twice-in-a-row/m-p/1595921#M2395</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use the LDT timer to make my system sleep for a specific amount of time.&lt;/P&gt;&lt;P&gt;The following function configures my LDT:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    // The counter must be disabled (~ENABLE) before reading its value and enabled again.
    bool const counter_should_be_running = false;
    status = FS65_LDT_RunCounter(counter_should_be_running);
    if (status != fs65StatusOk) return -1;

    // Long Duration Timer
    // The timer is configurable by the SPI and can operate in normal mode and low-power mode
    // The LDT as multiple functions
    // Function 4: In low-power mode, count until the counter reaches the wake-up value and wakes up.
    //
    // NXP FS6500, Product data sheet rev7.0, 12.8.3 Timer operation
    fs65_ldt_function_t const timer_is_our_alarm_clock = fs65LdtFunc4;
    status = FS65_LDT_SetTimerOperation(timer_is_our_alarm_clock);
    if (status != fs65StatusOk) return -1;

    // When function 4 is selected and the counter reaches the wake-up value (EOT), the device wakes up and the counter
    // is stopped.
    //
    // NXP FS6500, Product data sheet rev7.0, 12.8.3 Timer operation
    uint32_t const wakeup_value = sleep_time_sec; //&amp;lt; The timer is configured at 1 Hz
    status = FS65_LDT_SetWakeUpValue(wakeup_value);
    if (status != fs65StatusOk) return -2;

    bool const start_running = true;
    status = FS65_LDT_RunCounter(start_running);
    if (status != fs65StatusOk) return -3;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first time I call this function it works great.&lt;BR /&gt;The problem occurs when I call this function a second time: the LDT timer refuses to be disabled.&lt;/P&gt;&lt;P&gt;More specifically, the FS65_LDT_RunCounter(false) function fails because LDT_ENABLE is still set to 1.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gabrielfz_1-1675883174202.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/210175i024F6A7877DFC7D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gabrielfz_1-1675883174202.png" alt="gabrielfz_1-1675883174202.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The proof of the&amp;nbsp;LDT_ENABLE is still set.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gabrielfz_0-1675883117078.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/210174iD9E56ED0E7CE4249/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gabrielfz_0-1675883117078.png" alt="gabrielfz_0-1675883117078.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What is the proper way to configure the timer so it can be used twice in a row?&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Gabriel&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2023 19:08:55 GMT</pubDate>
    <dc:creator>gabriel-fz</dc:creator>
    <dc:date>2023-02-08T19:08:55Z</dc:date>
    <item>
      <title>SBC FS65 - Cannot use the LDT Timer twice in a row</title>
      <link>https://community.nxp.com/t5/Power-Management/SBC-FS65-Cannot-use-the-LDT-Timer-twice-in-a-row/m-p/1595921#M2395</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use the LDT timer to make my system sleep for a specific amount of time.&lt;/P&gt;&lt;P&gt;The following function configures my LDT:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    // The counter must be disabled (~ENABLE) before reading its value and enabled again.
    bool const counter_should_be_running = false;
    status = FS65_LDT_RunCounter(counter_should_be_running);
    if (status != fs65StatusOk) return -1;

    // Long Duration Timer
    // The timer is configurable by the SPI and can operate in normal mode and low-power mode
    // The LDT as multiple functions
    // Function 4: In low-power mode, count until the counter reaches the wake-up value and wakes up.
    //
    // NXP FS6500, Product data sheet rev7.0, 12.8.3 Timer operation
    fs65_ldt_function_t const timer_is_our_alarm_clock = fs65LdtFunc4;
    status = FS65_LDT_SetTimerOperation(timer_is_our_alarm_clock);
    if (status != fs65StatusOk) return -1;

    // When function 4 is selected and the counter reaches the wake-up value (EOT), the device wakes up and the counter
    // is stopped.
    //
    // NXP FS6500, Product data sheet rev7.0, 12.8.3 Timer operation
    uint32_t const wakeup_value = sleep_time_sec; //&amp;lt; The timer is configured at 1 Hz
    status = FS65_LDT_SetWakeUpValue(wakeup_value);
    if (status != fs65StatusOk) return -2;

    bool const start_running = true;
    status = FS65_LDT_RunCounter(start_running);
    if (status != fs65StatusOk) return -3;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first time I call this function it works great.&lt;BR /&gt;The problem occurs when I call this function a second time: the LDT timer refuses to be disabled.&lt;/P&gt;&lt;P&gt;More specifically, the FS65_LDT_RunCounter(false) function fails because LDT_ENABLE is still set to 1.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gabrielfz_1-1675883174202.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/210175i024F6A7877DFC7D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gabrielfz_1-1675883174202.png" alt="gabrielfz_1-1675883174202.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The proof of the&amp;nbsp;LDT_ENABLE is still set.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gabrielfz_0-1675883117078.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/210174iD9E56ED0E7CE4249/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gabrielfz_0-1675883117078.png" alt="gabrielfz_0-1675883117078.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What is the proper way to configure the timer so it can be used twice in a row?&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Gabriel&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 19:08:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Power-Management/SBC-FS65-Cannot-use-the-LDT-Timer-twice-in-a-row/m-p/1595921#M2395</guid>
      <dc:creator>gabriel-fz</dc:creator>
      <dc:date>2023-02-08T19:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: SBC FS65 - Cannot use the LDT Timer twice in a row</title>
      <link>https://community.nxp.com/t5/Power-Management/SBC-FS65-Cannot-use-the-LDT-Timer-twice-in-a-row/m-p/1596080#M2396</link>
      <description>&lt;P&gt;what do you mean&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;twice in a row?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;First time use the LDT wakeup SBC from LPOFF mode, now the SBC is waken up,what about the second time LDT?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 01:48:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Power-Management/SBC-FS65-Cannot-use-the-LDT-Timer-twice-in-a-row/m-p/1596080#M2396</guid>
      <dc:creator>guoweisun</dc:creator>
      <dc:date>2023-02-09T01:48:20Z</dc:date>
    </item>
  </channel>
</rss>

