Dave Dribin wrote: > > Twenty dollars says that the CRC is being calculated correctly, > > but your serial-out routine (and whatever other junk you've put > > between the PIC's registers and your eyes) is corrupting the > > data that you see. > > I thought of that and have double checked the serial code. The serial > routines do not to touch `crc_high' nor `crc_low'. Right, that's exactly my point. CRC_HI and CRC_LO are just fine, but your serial code (or your one-byte-to-two-ASCII-hex-characters routine, or your PC terminal program, or your serial-port settings, or whatever) is showing the wrong information. It's EXTRAORDINARILY unlikely that your serial routines are corrupting any data... But if you want to know for certain, make these changes to your code: 1. Duplicate the "MOVFW saved"/"CALL SerPrintHexByte" lines at the start of the routine. 2. Duplicate the 4 lines betweeen "MOVFW crc_hi" and "CALL SerPrintHexByte" at the end of the routine. The idea is to send two copies of each value. If your serial routines corrupt "saved", "crc_hi", or "crc_lo", the second copy will be different from the first. -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu