Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/16/07 11:22
Read: times


 
#143332 - code sketch
Responding to: ???'s previous message
For a start I'd try something like this now:

The sum starts with something non-zero to avoid all zero data bytes and all I do is adding the data to this.

WORD sum;
BYTE chksum;

sum=0x3c45;
for(i=EEPROM_MONITOR;i<EEPROM_CHECKSUM;i++)
	sum += EEPROM_read(i);

chksum = 0xff-((BYTE)(sum & 0xff00) >> 8);


It reminds me a bit of the XMODEM checksumming scheme as i think of it. I mainly need a YES/NO answer for the checksum to keep it simple.

Any further ideas?

cheers,
Matthias

List of 19 messages in thread
TopicAuthorDate
Simple EEPROM checksumming            01/01/70 00:00      
   Pitfalls            01/01/70 00:00      
      a checksum out of 2 bytes?            01/01/70 00:00      
         It's an "either - or" ...            01/01/70 00:00      
            code sketch            01/01/70 00:00      
               a simple checksum            01/01/70 00:00      
                  CRC8 instead of CR32            01/01/70 00:00      
                     I am talking about CRC-16 not CRC-8            01/01/70 00:00      
                        oups            01/01/70 00:00      
   how much data?            01/01/70 00:00      
      approx 40-60 bytes            01/01/70 00:00      
      I use 2 copies and a counter for that            01/01/70 00:00      
         adding to Jan's post            01/01/70 00:00      
   Here's one method            01/01/70 00:00      
      another interesting scheme!            01/01/70 00:00      
   Try the Dallas 1-wire CRC            01/01/70 00:00      
      another good idea but...            01/01/70 00:00      
         I just meant the CRC            01/01/70 00:00      
            oups            01/01/70 00:00      

Back to Subject List