<?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 Watchdog is enabled, but counter is not increasing in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Watchdog-is-enabled-but-counter-is-not-increasing/m-p/1457272#M63094</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am programming an S9KEAZ128 microcontroller, and I am running into a watchdog issue that I do not understand.&amp;nbsp;&lt;/P&gt;&lt;P&gt;At some point, I need to disable the watchdog to perform an operation, and then enable it again afterwards. The watchdog is correctly disabled. However, when I try to enable it again, the watchdog registers are correctly reconfigured as expected, but the watchdog timer is stuck at 0.&lt;/P&gt;&lt;P&gt;Here is the snippet of code that Disables the watchdog:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void Watchdog_disable(void)
{
    DisableInterrupts();

    WDOG-&amp;gt;CNT = WATCHDOG_CNT_UNLOCK_SEQUENCE_1;
    WDOG-&amp;gt;CNT = WATCHDOG_CNT_UNLOCK_SEQUENCE_2;

    WDOG-&amp;gt;TOVAL = WDOG_TOVAL_TOVAL(WATCHDOG_TOVAL_VALUE);

    WDOG-&amp;gt;CS2 = WDOG_CS2_CLK(WATCHDOG_CS2_CLK_1KHZ);

    WDOG-&amp;gt;CS1 = WDOG_CS1_UPDATE_MASK |
                WDOG_CS1_WAIT_MASK   |
                WDOG_CS1_STOP_MASK;

    EnableInterrupts();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the snippet of code that Enables the watchdog:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void Watchdog_enable(void)
{
    DisableInterrupts();

    WDOG-&amp;gt;CNT = WATCHDOG_CNT_UNLOCK_SEQUENCE_1;
    WDOG-&amp;gt;CNT = WATCHDOG_CNT_UNLOCK_SEQUENCE_2;

    WDOG-&amp;gt;TOVAL = WDOG_TOVAL_TOVAL(WATCHDOG_TOVAL_VALUE);

    WDOG-&amp;gt;CS2 = WDOG_CS2_CLK(WATCHDOG_CS2_CLK_1KHZ);

    WDOG-&amp;gt;CS1 = WDOG_CS1_UPDATE_MASK |
                WDOG_CS1_WAIT_MASK   |
                WDOG_CS1_STOP_MASK   |
                WDOG_CS1_EN_MASK;

    EnableInterrupts();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I couldn't find anything on the reference manual that would explain this behavior. I wonder if this is a problem with the silicon, and if so, if there is a workaround. I would appreciate it if anyone could shed some light on this.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 16 May 2022 14:02:58 GMT</pubDate>
    <dc:creator>JuanGalvez</dc:creator>
    <dc:date>2022-05-16T14:02:58Z</dc:date>
    <item>
      <title>Watchdog is enabled, but counter is not increasing</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Watchdog-is-enabled-but-counter-is-not-increasing/m-p/1457272#M63094</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am programming an S9KEAZ128 microcontroller, and I am running into a watchdog issue that I do not understand.&amp;nbsp;&lt;/P&gt;&lt;P&gt;At some point, I need to disable the watchdog to perform an operation, and then enable it again afterwards. The watchdog is correctly disabled. However, when I try to enable it again, the watchdog registers are correctly reconfigured as expected, but the watchdog timer is stuck at 0.&lt;/P&gt;&lt;P&gt;Here is the snippet of code that Disables the watchdog:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void Watchdog_disable(void)
{
    DisableInterrupts();

    WDOG-&amp;gt;CNT = WATCHDOG_CNT_UNLOCK_SEQUENCE_1;
    WDOG-&amp;gt;CNT = WATCHDOG_CNT_UNLOCK_SEQUENCE_2;

    WDOG-&amp;gt;TOVAL = WDOG_TOVAL_TOVAL(WATCHDOG_TOVAL_VALUE);

    WDOG-&amp;gt;CS2 = WDOG_CS2_CLK(WATCHDOG_CS2_CLK_1KHZ);

    WDOG-&amp;gt;CS1 = WDOG_CS1_UPDATE_MASK |
                WDOG_CS1_WAIT_MASK   |
                WDOG_CS1_STOP_MASK;

    EnableInterrupts();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the snippet of code that Enables the watchdog:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void Watchdog_enable(void)
{
    DisableInterrupts();

    WDOG-&amp;gt;CNT = WATCHDOG_CNT_UNLOCK_SEQUENCE_1;
    WDOG-&amp;gt;CNT = WATCHDOG_CNT_UNLOCK_SEQUENCE_2;

    WDOG-&amp;gt;TOVAL = WDOG_TOVAL_TOVAL(WATCHDOG_TOVAL_VALUE);

    WDOG-&amp;gt;CS2 = WDOG_CS2_CLK(WATCHDOG_CS2_CLK_1KHZ);

    WDOG-&amp;gt;CS1 = WDOG_CS1_UPDATE_MASK |
                WDOG_CS1_WAIT_MASK   |
                WDOG_CS1_STOP_MASK   |
                WDOG_CS1_EN_MASK;

    EnableInterrupts();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I couldn't find anything on the reference manual that would explain this behavior. I wonder if this is a problem with the silicon, and if so, if there is a workaround. I would appreciate it if anyone could shed some light on this.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 14:02:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Watchdog-is-enabled-but-counter-is-not-increasing/m-p/1457272#M63094</guid>
      <dc:creator>JuanGalvez</dc:creator>
      <dc:date>2022-05-16T14:02:58Z</dc:date>
    </item>
  </channel>
</rss>

