View previous topic :: View next topic |
Author |
Message |
Suus
Joined: 11 May 2004 Posts: 8
|
WDT reset |
Posted: Tue May 11, 2004 1:56 am |
|
|
Hello,
how can I check if there's been a watchdog reset?
Susan |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Tue May 11, 2004 2:10 am |
|
|
There is a function called restart_cause() that gives you the reason for reset. As for the values it returns, quoting from the manual: A value indicating the cause of the last processor reset.The actual values are device dependent. See the device .h file for specific values for a specific device. Some example values are: WDT_FROM_SLEEP, WDT_TIMEOUT, MCLR_FROM_SLEEP and NORMAL_POWER_UP. |
|
|
RKnapp
Joined: 23 Feb 2004 Posts: 51
|
|
Posted: Fri May 14, 2004 9:51 pm |
|
|
Yes -- however, if you're using the debugger, it will always show that the restart cause is "normal power up." Not sure why... Just something to watch out for...
Robert |
|
|
MGP
Joined: 11 Sep 2003 Posts: 57
|
|
Posted: Mon May 17, 2004 1:48 pm |
|
|
RKnapp wrote: | Yes -- however, if you're using the debugger, it will always show that the restart cause is "normal power up." Not sure why... Just something to watch out for...
Robert |
Probably because the debugger drives the MCLR line to the target PIC low. That would look like a "normal power up" reset to the PIC and would be reflected in the target PIC status bits. That's just a guess on my part, but it seems logical. |
|
|
|