On Mon, Aug 19, 2002 at 04:16:23PM -0700, Andrew Warren wrote: > 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. Ok, I see what you were getting at. I added this code to the beginning of my proggie: movlw 255 movwf count movlw 0 movwf byte out_bytes: movfw byte call SerPrintHexByte call SerPrintNewline incf byte, f decfsz count, f goto out_bytes movfw byte call SerPrintHexByte call SerPrintNewline And sure enough, 00 through FF all come out ok. No unexpected output. This would seem to verify SerPrintHexByte. I wrote a Perl script to verify the results, rather than just eyeball it, too. > 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: I tried this and sure enough, the same thing was printed both times. I'm stumped. This makes no logical sense. I've got to be missing something here. I guess this is where an ICE would help out, huh? :) I'm just gonna dump this code, but at the same time I would like to know what is the root cause of the problem here. -Dave -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads