"Joerg" <> wrote in message
news:kSeOg.1655$ t...
> Hello Martin,
>> OK, a bit late in the thread, but
>> http://ganssle.com/watchdogs.htm
>
> Thanks, very nice link. Jack really knows his stuff and I subscribed to
> his Embedded Muse.
>
> One statement in there that I don't really get is this: "Reloading the
> program counter may not properly reinitialize the CPU’s internals." I'd
> have thought that properly written code will do one thing first: Set all
> the CPU internals before doing anything.
Yes, true. But that doesn't necessary put all the CPU hardware in the same
state as a hardware reset. You'd think so, wouldn't you, but it doesn't.
If you've done any hardware design, you'll know about excluded states (which
are hardware states that normal sequencing won't exit from). Following an
EMI glitch (not normal software behaviour, or even software runaway), the
state of the CPU is effectively random. If you're really unlucky, you could
wind up with an excluded state somewhere on the CPU. (Or more likely a
microcontroller - more on-chip subsystems.)
I've seen this happen in practice, with code which did indeed reset
everything as per the datasheet. The CPU partially worked, but not
completely. This wasn't my design, and I was trying to convince the designer
to use a hardware watchdog, when this came up. Result: he used a hardware
watchdog.
Steve
http://www.fivetrees.com