Just about everything you read about PICs says turn the watcrchdog off. What is the purpose of the watchdog then?
I have had a few cases of the PIC freezing up (at least the LCD freezes up, not absolutely sure if this means the PIC has stopped running too, or is just stuck in a continouos loop) and I’d like the watchdog to detect this and reboot the PIC. Will it do this if I turn it on?
What kind of things does the watchdog detect? E.g a divide by zero?
Ideally I’d find the cause of this freezing, but just in case, it’s safer in my case to continuously reboot than to freeze up.
Watchdog
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
The WDT basically used an internal timer that resets your program if this timer overruns. You use it within your program by making sure the watchdog timer is constantly reset throughout your program (using the C function clrwdt).
Unfortunately, Flowcode (or specifically, the C compiler "underneath" Flowcode) does not reset the WDT during the delay instruction. This means you cannot realistically use the WDT within Flowcode.
Unfortunately, Flowcode (or specifically, the C compiler "underneath" Flowcode) does not reset the WDT during the delay instruction. This means you cannot realistically use the WDT within Flowcode.