I've never been able to understand using the built-in watchdog timer on PIC micros. I know what they do, but I'm confused on how to properly program them.
I use MPLAB X IDE with microchip's XC8 compiler to program in C language.
I understand that the watchdog timer overflows at a nominal rate of 18ms without using a postscaler, so my questions are...
How do I ensure that during program execution, the WDT gets reset in time every time? Do I need to count clock cycles and put a clear WDT instruction in multiple locations throughout the program?
Also, if I had a routine that called a long delay, such as many seconds long, would the WDT not force a reset during this delay?
Thanks for the input, and let me know if I need to clarify something.
I use MPLAB X IDE with microchip's XC8 compiler to program in C language.
I understand that the watchdog timer overflows at a nominal rate of 18ms without using a postscaler, so my questions are...
How do I ensure that during program execution, the WDT gets reset in time every time? Do I need to count clock cycles and put a clear WDT instruction in multiple locations throughout the program?
Also, if I had a routine that called a long delay, such as many seconds long, would the WDT not force a reset during this delay?
Thanks for the input, and let me know if I need to clarify something.