{"id":1404,"date":"2023-09-14T16:49:50","date_gmt":"2023-09-14T15:49:50","guid":{"rendered":"https:\/\/ibex.tech\/embedded\/?p=1404"},"modified":"2023-09-14T16:49:50","modified_gmt":"2023-09-14T15:49:50","slug":"pic32m-watchdog-timer","status":"publish","type":"post","link":"https:\/\/ibex.tech\/embedded\/microchip\/pic32\/xc32\/watchdog-timer-xc32\/pic32m-watchdog-timer","title":{"rendered":"PIC32M Watchdog Timer"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Useful macros to use<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#define\tEnableWDT(state)\tWDTCONbits.ON = state\t\t\t\/\/1=enabled, 0=disabled (Note WDT needs to be cnfigured in the main device CONFIG bits to be used)\r\n#define\tEnableWindowedWDT\tWDTCONbits.WDTWINEN = state;\t\/\/1=enabled, 0=disabled\r\n#define ClearWDT()\tvolatile uint16_t * wdtclrkey = ( (volatile uint16_t *)&amp;WDTCON ) + 1; *wdtclrkey = 0x5743\t\t\/\/Writing specific value to only upper 16 bits of WDTCON register clears WDT counter<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Then in your code<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Application initialise\n\tEnableWDT(1);\n\n\/\/In your main loop\r\n\tClearWDT();<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Useful macros to use Then in your code<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[110],"tags":[],"class_list":["post-1404","post","type-post","status-publish","format-standard","hentry","category-watchdog-timer-xc32"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/1404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/comments?post=1404"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/1404\/revisions"}],"predecessor-version":[{"id":1405,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/1404\/revisions\/1405"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/media?parent=1404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/categories?post=1404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/tags?post=1404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}