I am wondering if the wdt will re-start the PIC if prog execution somehow stops,
is there a way to test the wdt ?
don
amgen
I am wondering if the wdt will re-start the PIC if prog execution somehow stops,
is there a way to test the wdt ?
don
amgen
Yes. If program execution stops, and you have the WDT enabled, it will cause a reset. That's what it's for.I am wondering if the wdt will re-start the PIC if prog execution somehow stops
There are some exceptions like entering SLEEP, and waking up with the watch-dog timer where it will continue executing code after the sleep instruction, but this is all in the data sheet and easy to lookup.
No, but some PICs have a register that indicates what caused a device reset.is there a way to test the wdt ?
thanks Bruce,
I had an idea in the middle of the night that I tried, which seemed to work.
take a pin and use for an input push-button switch,
in a PICbasic program, test for sw push then do.........
asmhere nopendasm
goto here
.....a dead end loop with no wdt-reset
the pic would re-start normal operation after a period and timed out with different settings of wdt timeout.
it would not be a bad reset type initiated by a push-button.
don
amgen
Hi Don,
Very cool idea. Using the assembler loop, PBP can't reset WDT...;o}
Edit: I was just thinking. You can force the same timeout period for the WDT reset by inserting a clrwdt instruction just above the loop label. Thanks for sharing the idea. I have something I'm working on now where this works great.
Last edited by Bruce; - 19th January 2009 at 18:30. Reason: Edit: Another idea
Bookmarks