|
Quote:
I suppose some applications are critical on the inital state of the CPU registers, but it would be bad coding practice to assume that the GPR are initialized to zero. I don't think GCC makes that assumption when using register variables. In any case the WDT is a good way to clear out the processor to it's init state.
The real gotcha are any unhandled ??IE?? bits that are set when you sei(). For tiny/mega then WDT is the perfect way to reset the h/w. For Xmega it has a more direct mechanism to force a reset of the CPU state machine. |