<?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 wdog not causing a reset in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/wdog-not-causing-a-reset/m-p/337571#M16103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, I think things are set up correctly but for some reason I am not getting a WDOG timeout-reset.&amp;nbsp; Things should be set to generate a WDOG timeout @ about 100 mS.&amp;nbsp; Once I initialiize the WDOG I go into an infinite loop waiting for the timeout event to occure.&amp;nbsp; Any help as to why I am not resseting would be appreciated.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached my elf file to aid in debugging. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337636"&gt;8093_Rev_AA_1.elf.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Sep 2014 19:27:48 GMT</pubDate>
    <dc:creator>patrickfoley</dc:creator>
    <dc:date>2014-09-03T19:27:48Z</dc:date>
    <item>
      <title>wdog not causing a reset</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/wdog-not-causing-a-reset/m-p/337571#M16103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, I think things are set up correctly but for some reason I am not getting a WDOG timeout-reset.&amp;nbsp; Things should be set to generate a WDOG timeout @ about 100 mS.&amp;nbsp; Once I initialiize the WDOG I go into an infinite loop waiting for the timeout event to occure.&amp;nbsp; Any help as to why I am not resseting would be appreciated.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached my elf file to aid in debugging. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337636"&gt;8093_Rev_AA_1.elf.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 19:27:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/wdog-not-causing-a-reset/m-p/337571#M16103</guid>
      <dc:creator>patrickfoley</dc:creator>
      <dc:date>2014-09-03T19:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: wdog not causing a reset</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/wdog-not-causing-a-reset/m-p/337572#M16104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK I tried modifying my code to eliminate any confusion about the endianness of the cnt register.&amp;nbsp; I am now writing each individual byte of the unlock key.&amp;nbsp; Where my code used to be&amp;nbsp; WDOG_CNT = 0x20C5 it is now WDOG_CNTH = 0x20; WDOG_CNTL = 0xC5;&amp;nbsp; I am still getting issues.&amp;nbsp; As soon as I try to write the first byte of the unlock sequence I generate a WDOG reset.&amp;nbsp; This is also strange considering that the WDOG_EN bit is cleared.&amp;nbsp; I have tried writting to the Lower register first as I have seen some MCU's with the issue where byte order is important. I am at my wits end trying to get something as simple as a WDOG timeout to occure.&amp;nbsp; Either my code does not reset the devise, sets the WDOG registers appropriately BUT does not reset while in an inf. loop without refreshing the WDOG, OR I get a WDOG reset while trying to write the unlock/refresh sequence.&amp;nbsp; Again here is an elf file to aid in debugging.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 20:56:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/wdog-not-causing-a-reset/m-p/337572#M16104</guid>
      <dc:creator>patrickfoley</dc:creator>
      <dc:date>2014-09-03T20:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: wdog not causing a reset</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/wdog-not-causing-a-reset/m-p/337573#M16105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following enables a 2s watchdog timeout on a Kinetis K-series processor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WDOG_UNLOCK = WDOG_UNLOCK_SEQUENCE_1; // 16 bit write of 0xc520 to 0x4005200e&lt;/P&gt;&lt;P&gt;WDOG_UNLOCK = WDOG_UNLOCK_SEQUENCE_2; // 16 bit write of 0xd928 to 0x4005200e&lt;/P&gt;&lt;P&gt;WDOG_TOVALL = 2000; // this would be 100 for 100ms&lt;/P&gt;&lt;P&gt;WDOG_TOVALH = 0;&lt;/P&gt;&lt;P&gt;WDOG_STCTRLH = (WDOG_STCTRLH_STNDBYEN | WDOG_STCTRLH_WAITEN | WDOG_STCTRLH_STOPEN | WDOG_STCTRLH_WDOGEN); // set also WDOG_STCTRLH_ALLOWUPDATE to allow subsequent changes to be made&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 21:42:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/wdog-not-causing-a-reset/m-p/337573#M16105</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-09-03T21:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: wdog not causing a reset</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/wdog-not-causing-a-reset/m-p/337574#M16106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From another thread it becomes clear that you are using a KE and not K. The KE code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WDOG_UNLOCK = 0x20c5;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WDOG_UNLOCK = 0x28d9;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WDOG_CS2 = (WDOG_CS2_CLK_1kHz | WDOG_CS2_FLG);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WDOG_TOVAL = BIG_SHORT_WORD(2000); // 2000ms&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WDOG_WIN = 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WDOG_CS1 = (WDOG_CS1_EN); // enable watchdog - set WDOG_CS1_UPDATE to allow future updates&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the timeout value is big-endian:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#define BIG_SHORT_WORD(x) (unsigned short)((x &amp;lt;&amp;lt; 8) | (x &amp;gt;&amp;gt; 8))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. If you test with 100ms timeout with the TOVAL endian incorrectly you will get a timeout of about 25s instead of 100ms!&lt;/P&gt;&lt;P&gt;As you can see, the KE implementation is big-endian whereas the K implemetation is little-endian (although the watchdog is different it is otherwies very similar) so some confusion can result.&lt;/P&gt;&lt;P&gt;If you decide to use a KL it has a completely different watchdog again...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 22:29:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/wdog-not-causing-a-reset/m-p/337574#M16106</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-09-03T22:29:03Z</dc:date>
    </item>
  </channel>
</rss>

