{"id":119,"date":"2012-05-24T08:58:08","date_gmt":"2012-05-24T08:58:08","guid":{"rendered":"http:\/\/www.electronic-products-development.com\/?p=119"},"modified":"2022-02-18T15:37:50","modified_gmt":"2022-02-18T15:37:50","slug":"reset","status":"publish","type":"post","link":"https:\/\/ibex.tech\/embedded\/microchip\/pic32\/c32-compiler\/reset","title":{"rendered":"Reset"},"content":{"rendered":"<h4>\nReset<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\/\/Reset to 0x0000:\r\nSoftReset(); \r\n<\/code><\/pre>\n<h4>\nDid Watchdog reset occur<br \/>\n<\/h4>\n<pre>\r\n<code>\r\nif (ReadEventWDT())\r\n\/\/WDT reset has occurred\r\n<\/code><\/pre>\n<h4>\nGenerating Reset in Code<br \/>\n<\/h4>\n<p>\nIf you want to use your own code as an alternative to the C32&nbsp;SoftReset function the following can be used instead:\n<\/p>\n<pre>\r\n<code>\r\nvoid software_reset(void)\r\n{\r\n   int t;\r\n\r\n   \/\/Unlock system\r\n   SYSKEY=0;\r\n   SYSKEY=0xaa996655;\r\n   SYSKEY=0x556699aa;\r\n\r\n   \/\/Do the reset\r\n   RSWRSTSET=1;    \/\/enable software reset\r\n   t=RSWRST;          \/\/reset the software enable bit to force the actual reset\r\n   while(1);\r\n}\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reset \/\/Reset to 0x0000: SoftReset(); Did Watchdog reset occur if (ReadEventWDT()) \/\/WDT reset has occurred Generating Reset in Code If you want to use your own code as an alternative to the C32&nbsp;SoftReset function the following can be used instead: void software_reset(void) { int t; \/\/Unlock system SYSKEY=0; SYSKEY=0xaa996655; SYSKEY=0x556699aa; \/\/Do the reset RSWRSTSET=1; \/\/enable [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-119","post","type-post","status-publish","format-standard","hentry","category-c32-compiler"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/119","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=119"}],"version-history":[{"count":5,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":547,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/119\/revisions\/547"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/media?parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/categories?post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/tags?post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}