micro self-check of checksum - Page 2

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Re: micro self-check of checksum
Quoted text here. Click to load it

The OP wanted to test the integrity more or less directly after power
on and in those cases it should be quite easy. The hardware shall be
designed in a way that it is in a safe state (provided it is not
broken) after reset. If the CPU fails to even fetch the reset vector
(or whatever it does first depending on architecture) nothing bad must
happen. If there is a checksum failure there is no sense in going
further, entering an eternal loop takes a minimum of code which makes
it less likely to be affected by the code being corrupted.

Usually I design the hardware so that if there is an error indication
it is activated at power on and switched off by the software when it
is up and running. We also usually have watchdogs that are enabled by
software to avoid repeated resets if the software is halted due to
checksum failure. The watchdog is enabled after the checksum is
verified and then it can not be disabled.

So, in short, if detecting a checksum failure in an early stage after
reset, doing nothing is often the most sensible action.



Re: micro self-check of checksum
Thomas Magma schrieb:

Quoted text here. Click to load it

You need an PIC that can access the code space, but this feature isn't
implemented in every type. For example you can use 16F877A or 18F4550
(that if used last time).
On the Microchip website, there is at least one app-note (TB026), that
discusses your problem (with sample code).


Site Timeline