<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Problem with implementation of the watchdog interrupt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14466/problem-with-implementation-of-the-watchdog-interrupt</link><description>I ran watchdog with this code: 
 void wdt_init(void)
{
	NRF_WDT-&amp;gt;CONFIG = (WDT_CONFIG_HALT_Pause &amp;lt;&amp;lt; WDT_CONFIG_HALT_Pos) | ( WDT_CONFIG_SLEEP_Run &amp;lt;&amp;lt; WDT_CONFIG_SLEEP_Pos);
	NRF_WDT-&amp;gt;CRV = 1*32768; //1 sec. timeout
	NRF_WDT-&amp;gt;RREN |= WDT_RREN_RR0_Msk;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Jun 2016 08:11:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14466/problem-with-implementation-of-the-watchdog-interrupt" /><item><title>RE: Problem with implementation of the watchdog interrupt</title><link>https://devzone.nordicsemi.com/thread/55247?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2016 08:11:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca7b6e9c-cd78-4b70-ad8a-fd8847fb6fda</guid><dc:creator>AndrzejB</dc:creator><description>&lt;p&gt;I thought that two clock cycles means 2x32768 ticks of the clock, that is about 2 seconds :D. Thanks for set this straight for me&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with implementation of the watchdog interrupt</title><link>https://devzone.nordicsemi.com/thread/55249?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2016 08:01:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b70629c8-710d-4215-9bc7-18e805570759</guid><dc:creator>AndrzejB</dc:creator><description>&lt;p&gt;I just didn&amp;#39;t understand how to implement event handler, after analyzing the code of the wdt example I did it in the right way. I didn&amp;#39;t simply use the wdt example because I had problem with adding nrf_drv_wdt.c to my project. Besides, I wanted to learn how it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with implementation of the watchdog interrupt</title><link>https://devzone.nordicsemi.com/thread/55248?ContentTypeID=1</link><pubDate>Tue, 14 Jun 2016 14:58:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d33d07f-b266-40cf-af07-614e02c99235</guid><dc:creator>John</dc:creator><description>&lt;p&gt;I&amp;#39;m a bit confused as to why you would want to call the WDT IRQ handler out of a timer. The system should invoke that function itself without it being in a timer. I&amp;#39;d suggest using Nordic&amp;#39;s WDT driver as it already implements all of this for you. All you need to do is set up a configuration structure and call their init function. You can find it in SDK 11 components\drivers_nrf\wdt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with implementation of the watchdog interrupt</title><link>https://devzone.nordicsemi.com/thread/55246?ContentTypeID=1</link><pubDate>Tue, 14 Jun 2016 14:57:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ee2934b-0529-4bfc-b73e-9f0af0a43dbb</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;There is some WDT with interrupt example code for SDK 11.0.0 available &lt;a href="https://github.com/NordicSemiconductor/nrf51-watchdog-resetreas-example/blob/master/watchdog_simple_with_interrupt/main.c"&gt;here&lt;/a&gt;, but without softdevice. There is also another branch there for nRF51 SDK 5.2.0 which has code for WDT with softdevice. Perhaps you can benefit looking at that as well.&lt;/p&gt;
&lt;p&gt;The watchdog reset is anyhow triggered when the watchdog timeout occurs, which delays the watchdog reset by 2x 32kHz clock cycles while executing the WDT interrupt handler, which is around 61 microsecond. You should be able to write one word to flash in that time, which takes maximum 46us according to the specification. Additionally it might take up to 10 microseconds to start execution of the interrupt handler after the WDT timeout interrupt is triggered.&lt;/p&gt;
&lt;p&gt;To prevent other interrupts from blocking the WDT interrupt, you might also want to set the WDT interrupt as high priority.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>