| ??? 09/06/02 17:01 Read: times |
#28754 - RE: P89C51RD2 Internal WatchDog Timer |
I have used the PCA watchdog timer in other CPUs. It is not a very easy watchdog to implement effectively, especially if you are using the PCA timer for other things. It is also far from infallible. However, it is still better than no watchdog.
The watchdog in the T89C51RD2 (I haven't checked the P89...) allows a period of just over 2 seconds, which is plently long for my current application. And the product it is replacing had a watchdog period of about 6 seconds, so it is still fast enough. Anyway, the way I typically implement the WD depends on the interrupt stucture. One application had a 1-second pulse coming from an RTC chip wired to an external interrupt, and a 5 ms timer interrupt. In each interrupt, I set a bit (in a bitaddressable byte). My 'kick the dog" function would only reset the WD if all interrupt flags have been set. The function was only called from the main program, never from within an interrupt. However, if either interrupt stopped ticking, the CPU would reset. |



