EmbeddedRelated.com
Forums
Memfault Beyond the Launch

A state machine question

Started by Unknown April 8, 2006
On 8 Apr 2006 12:04:32 GMT, Hans-Bernhard Broeker
<broeker@physik.rwth-aachen.de> wrote:

>johnwang1wang@yahoo.com wrote: >> I am implementing a state machine which has the following requirement: >> If the state machine is interrupted by power off, the state machine >> shall resume from where it was interrupted after the program is >> restarted ( power on in this case). > >That's a dubious plan.
In core memory systems, it was easy to save the internal state and resume execution at the next instruction, when the power was restored. While the internal state was nicely preserved, the "external" real word situation might no longer match the stored internal state. Assuming input A changes state before input B you should end in one state, but if B changes before A, you should end in an other state in the state diagram. If both A and B changes state during the state machine power failure and both are ON when the power is restored, did A change before B or vice versa and what should the final state be ? Thus, it is not enough to store the internal state, but you should also check that similar situations do not exist in the state diagram or have a special transition if both A and B becomes simultaneously ON (indicating a restoration of state machine power). In more complex systems it would be highly dangerous to resume operation with the settings used before the power failure, without checking the current state of the external world after power restoration. Paul

Memfault Beyond the Launch