<?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: watchdog timer in MKV46F256VLL16 in MCUXpresso IDE</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1233848#M6726</link>
    <description>&lt;P&gt;Hello &lt;A id="link_12" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/183199" target="_self"&gt;soaring_sun&lt;/A&gt;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;I will gladly answer your questions.&lt;BR /&gt;In the "while" cycle the watchdog timer is running without being fed, since the watchdog is not refreshing the MCU will be restarted by the module and increase the reset count.&lt;BR /&gt;&lt;BR /&gt;Let me know if this is helpful, if you have more questions do not hesitate to ask me.&lt;BR /&gt;Best regards,&lt;BR /&gt;Omar&lt;/P&gt;</description>
    <pubDate>Fri, 19 Feb 2021 20:43:46 GMT</pubDate>
    <dc:creator>Omar_Anguiano</dc:creator>
    <dc:date>2021-02-19T20:43:46Z</dc:date>
    <item>
      <title>watchdog timer in MKV46F256VLL16</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1231401#M6713</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have been working on the usage of watch dog timer in my application. For this, I have referred the example project. I needed a few clarifications regarding the example project to help me understand better.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 817px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/137238i272FC4FB4D7A090C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Capture.PNG&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here, there is an infinite while loop that runs after a few instructions are executed. But in the console, I see that the compiler does not get stuck at this point, but continues to run further lines. How is that possible? If I un-comment the line within the while loop, then the compiler gets stuck in the infinite loop. Why is that?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 553px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/137239i586E1B2EB3599F50/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Capture.PNG&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The same applies to the next set of instructions. Here the wdog_reset_counter is getting updated from WDOGResetCount(); How is this changed every time? Which function is causing this change?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 08:37:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1231401#M6713</guid>
      <dc:creator>soaring_sun</dc:creator>
      <dc:date>2021-02-16T08:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: watchdog timer in MKV46F256VLL16</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1233848#M6726</link>
      <description>&lt;P&gt;Hello &lt;A id="link_12" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/183199" target="_self"&gt;soaring_sun&lt;/A&gt;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;I will gladly answer your questions.&lt;BR /&gt;In the "while" cycle the watchdog timer is running without being fed, since the watchdog is not refreshing the MCU will be restarted by the module and increase the reset count.&lt;BR /&gt;&lt;BR /&gt;Let me know if this is helpful, if you have more questions do not hesitate to ask me.&lt;BR /&gt;Best regards,&lt;BR /&gt;Omar&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 20:43:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1233848#M6726</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2021-02-19T20:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: watchdog timer in MKV46F256VLL16</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1233921#M6727</link>
      <description>&lt;P&gt;Oh, that explains a lot. Thank you.&lt;/P&gt;&lt;P&gt;I went ahead to use the same logic in my program. So, I now want to use a watchdog timer, give a timer value and refresh it before the watchdog expires so that my program will continue to work without resetting the MCU.&lt;/P&gt;&lt;P&gt;The following is the program that I am using. I am using an interrupt to generate a 20ms flag. Every 20ms I refresh the watchdog so as to not to reset MCU. Timeout value is 0x28 in hex for 40ms considering LPO = 1KHz. (Is that the right way to calculate??)&lt;/P&gt;&lt;P&gt;To make sure that my program is running smoothly, I have a running pwm pulse and I'm monitoring it. But on the oscilloscope, I notice that there is a glitch every 20ms which halts the pulsing.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	WDOG_GetDefaultConfig(&amp;amp;config);
	config.timeoutValue = 0x28U;
	WDOG_Init(wdog_base, &amp;amp;config);
	while (1)
	{
		if(flag_20ms == 1)
		{
			flag_20ms = 0;
			GPIO_PortToggle(GPIOD, 1u &amp;lt;&amp;lt; 1u);
			WDOG_Refresh(wdog_base);
		}
	}&lt;/LI-CODE&gt;&lt;P&gt;Where am I going wrong? For my application, is there a need for interrupt to be used? Is this the right way to initialize WDOG?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I remove the interrupts and only run the program with watchdog, then ate every 20ms, the console gets refreshed and the MCU is reset. How can I avoid this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	WDOG_GetDefaultConfig(&amp;amp;config);
	config.timeoutValue = 0x28U;
	WDOG_Init(wdog_base, &amp;amp;config);

	for(int i = 0; i &amp;lt; 10; i ++)
	{
		PRINTF("--- Refresh wdog %d time ---\r\n", i + 1);
	}

	while (1)
	{
//		if(flag_20ms == 1)
		{
//			flag_20ms = 0;
//			GPIO_PortToggle(GPIOD, 1u &amp;lt;&amp;lt; 1u);
			WDOG_Refresh(wdog_base);
		}
	}&lt;/LI-CODE&gt;&lt;P&gt;the console reading is as follows&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 226px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/137632i37E0372E9B01F850/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Capture.PNG&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Help me figure this out.&lt;/P&gt;&lt;P&gt;thank you in advance&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 10:18:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1233921#M6727</guid>
      <dc:creator>soaring_sun</dc:creator>
      <dc:date>2021-02-20T10:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: watchdog timer in MKV46F256VLL16</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1236097#M6737</link>
      <description>&lt;P&gt;Hello &lt;BR /&gt;&lt;BR /&gt;The time-out value is defined in terms of cycles of the watchdog clock so the value you set is correct.&lt;BR /&gt;You can use the interruption when you want to execute other tasks in your program and only refresh the watchdog when it is necessary, the interruption will allow you concurrency.&lt;BR /&gt;Which timer are you using to generate the 20ms interruption? It would be helpful if you attach a picture of the glitch on the PWM.&lt;BR /&gt;I suggest before starting an update or refresh sequence, disable global interrupts, after the sequence finishes, restore global interrupts.&lt;/P&gt;
&lt;P&gt;I look forward to your reply, if you have more questions do not hesitate to ask me.&lt;BR /&gt;Best regards,&lt;BR /&gt;Omar&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 20:41:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1236097#M6737</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2021-02-24T20:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: watchdog timer in MKV46F256VLL16</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1236296#M6739</link>
      <description>&lt;P&gt;Hi Omar,&lt;/P&gt;&lt;P&gt;I am using PWM interrupt timer of 15KHz to generate 20ms. I saw that in the&amp;nbsp;BOARD_InitBootPins(); function, watchdog was already initialized due to which it was getting a double command. Once that init function was made okay, the watchdog seemed to work properly as I expected.&lt;/P&gt;&lt;P&gt;Now that I have initialized my own watchdog with my own instructions, I went ahead to do the same with the config tools. In the clock section, I have selected the watchdog timer to be active and have selected LPO frequency for operation. Once this is set, I go the peripheral section to generate the code. But unfortunately, I find that there is no provision for me to generate.&lt;/P&gt;&lt;P&gt;Why does that happen? Have I missed any configuration? Should the MCG mode be different? Shouldn't watchdog be operational at all modes? Or should I be manually be writing the code for it?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (20).png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/138070iACDB55454E77905A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (20).png" alt="Screenshot (20).png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Screenshot (20).png&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (21).png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/138071iA08C28CCBF344314/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (21).png" alt="Screenshot (21).png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Screenshot (21).png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please send a manual which describes which mode to be used during these operations as it is not clear in the TRM.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 05:03:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1236296#M6739</guid>
      <dc:creator>soaring_sun</dc:creator>
      <dc:date>2021-02-25T05:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: watchdog timer in MKV46F256VLL16</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1237702#M6747</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I had to add the watchdog driver to make sure that it was activated in the peripheral driver section to program it. Once it was done, I was able to program it.&lt;/P&gt;&lt;P&gt;My bad.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 05:35:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/watchdog-timer-in-MKV46F256VLL16/m-p/1237702#M6747</guid>
      <dc:creator>soaring_sun</dc:creator>
      <dc:date>2021-03-01T05:35:34Z</dc:date>
    </item>
  </channel>
</rss>

