??? 07/21/04 17:04 Read: times |
#74625 - RE: WD in lengthy functions Responding to: ???'s previous message |
Except if the runaway code falls into another piece of program with WD reset. :P (these reset chunks often must be scattered in quite a few places of the memory to keep your program running...) I'd prefer if it had, say, a "recently reset" flag that stays lit for a few cycles after reset.
i.e. ;blah blah WDRST1: MOV WDTRST,#0x1E MOV WDTRST,#0xE1 JNB WDRECENT,WDRST1 If interrupt happens during the reset, the watchdog won't be reset until interrupt ends, WDRECENT remains low, as watchdog hasn't been reset recently. If the three above instructions happen in a row, WDRECENT will be set to 1 for long enough to pass JNB. |