Re: [EE] High reliability store and recall of data in EEPROM
Jason White <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.pic |
|---|---|
| Message-ID | <CAOFvGD5vB=cGKByOP1OjyJ_vQPJyrOV8ypeTBsw43o292m6=9Q@mail.gmail.com> |
Consider using an 8-bit CRC three or four times in a row. One byte of the original value, byte two is your CRC function called on the value once in a row byte three is your CRC function called on the value twice in a row byte four is your CRC function called on the value thrice in a row On Fri, Dec 6, 2024 at 4:51 PM David VanHorn <[email protected]> wrote: > I have a need to store some data in non-volatile memory, with the caveat > that corrupt data MUST NOT occur. Things go "big badda boom" otherwise. > > Offhand, I came up with storing each byte as a four byte array (I have TONS > of space available) > If I'm storing 0x01 then it would look like this: > > 1 2 3 4 > 0x01, 0xFE, 0x01, 0x55 > > Xor 1 and 2, result must be zero. > Xor 3 and 2, result must be zero. > compare 1 and 3 result must be zero (not sure this is needed) > check 4, must be 0x55 otherwise a wild write has happened in EE. > Finally the values allowed will be sparse, and likely only a single bit > will be set, so I will check that the value I read is one of the allowable > values. > > If any of those checks fails, we render safe and halt. > > Is there a more "rock solid" method? What would be done in an automotive > environment for something like throttle position? What would be best > practice for medical life safety? > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > https://mailman.mit.edu/mailman/listinfo/piclist > -- Jason White -- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at https://mailman.mit.edu/mailman/listinfo/piclist