Thanks for the answer, Darrell. However, your answer raises some questions that I would like to understand the "why" of as a PICBASIC programmer so that I am not just blindly implementing code:
1) How is a PICBASIC programmer supposed to know that the WDT must be kept clear during the Main loop of a program when using the INT2 external intterupt of the DT_INTS-18 include file? I went through the code/comments of DT_INTS-18 and couldn't find anything that advises that.
2) Must the WDT be kept clear during Main loop when using other interrupts supported by DT_INTS-18 or just for the external interrupts INT1 or INT2??
3) I did see the following note in the data sheet and am wondering if this implies that the WDT is an interrupt flag and must be cleared before using any interrupt???
"Interrupt flag bits are set when an interrupt condition occurs regardless of the state of its corresponding enable bit or the global
interrupt enable bit. User software should insure the appropriate interrupt flag bits are clear prior to enabling an interrupt.
This feature allows for software polling."
4) How does the use of the PAUSE statement insure that CLRWDT has been executed, whereas use of LOW or GOTO do not? I went through the instruction set in the data sheet and couldn't find anything that would indicate that.LOW and GOTO don't generate CLRWDT instructions.
<br>
Bookmarks