??? 07/14/06 07:32 Read: times |
#120246 - WD with indication Responding to: ???'s previous message |
Anders Sandström said:
for your processor, it will tell you if your processor has a builtin watchdog and if it sets a bit to indicate if a reset comes from a watchdog reset. As said above, some of the internal WD's are a crap. The "good" WD must:
Most of the internal resets barely fulfill half of the above requirements - check out e.g. the mentioned AT89S5x's WD, it fulfills (for me quite surprisingly) item 2 and 3 and the last item. Still, one can use external WD's. If you can't find a suitable IC which "tells" the reason of reset, make one yourself - use two reset circuits, one with WD and an another without WD, and catch the output of the WD-containing one into a latch, which output (and reset) is connected to the mcu. The mcu after being reset thus can "see" what was the reason of reset. Also, a good practice is to facilitate debugging in some way - if possible, make a "core dump" upon WD reset, or log the circumstances of it somehow. Of course, the choice of using WD at all depends on the particular application - WD itself can introduce errors (if you fail to feed it fast enough), and can hide software errors. It's a balancing act. Jan Waclawek |