Forrest W Christian ha scritto: > I've got an application where I need to CRC program memory and be as > sure as I can be about it having a correct checksum - I don't want to > jump to a bit-errored program. I'm thinking some sort of CRC checksum, > probably 32 bit (or two different 16 bit algorithms) - I can live with a > 1 in 4.2billion chance of it actually being an errored program. Not so > much one in 65,536. > > I'm aware that different checksum algorithms are more sensitive to > certain types of errors - for instance the CRC was specifically > developed to catch bit-errors in a serial bitstream. I've also seen > other discussions about different modifications of the CRC or other > algorithms specifically to catch bit errors common in other mediums. > > Mailnly I'm looking for something well suited to common flash memory > failures (words not quite programmed, or failures, etc.), and also which > will catch some of the likely flash-update algorithm failures (i.e. > missed programming a block of 16 for some reason, etc).. but I don't > seem to be able to locate anything specifically related to this type of > application - instead everything seems to be a serial checksum or > similar (magnetic media, etc), applied to program memory, and stating > some nebulus claim about it being 'better' than a normal checksum ... > which may or may not be true when applied to flash program memory. Hi Forrest, I use a 8bit one on my (now old) RS485 based home automation devices :) (time to consider an upgrade indeed, but it works pretty fine in non-noisy environments). As you pointed out, different CRC (and CRC seeds) apply to different scenarios, so it's actually usually better than 1:65535 or 1:4billions ratio. Depending on the kind of errors that you do expect, you may pick a better one for your needs. I'd say that nowadays a CCITT-alike CRC16 is well within any PIC 18 or above capabilities. CRC32, I don't know, and I don't know if it's worth indeed... -- Ciao, Dario -- Cyberdyne -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist