On Tue, Aug 20, 2002 at 10:47:21AM -0700, Scott Dattalo wrote: > The other night I was looking at: > > http://www.geocities.com/SiliconValley/Pines/8659/crc.htm#r19 Yes, I've been reading that doc. I've been trying to transform Ashley's code to created a reflected table look as per Section #11 for the 0x8005 poly. > You can change the Polynomial, whether it's reversed or not, and table > width. I never could replicate the tables Ashley had created nor could > I get the crc code on the above web pages to generate the same CRC's for > the 0x1021 polynomial. Either the above crc code is wrong, Ashley's code > is wrong, or I'm wrong. I strongly suspect that I'm missing something. FWIW, I can use Ashley's C code to produce a 0x8005 CRC-16 table with correct results. I'm actually sending the CRC to a device that rejects the data if the CRC is incorrect, so I've got an "independant third party" to also verify the results, if you will. :) However, I have to reflect the data before calling CRC16_Update() and I have to reflect CRC16_High and CRC16_Low before using them. I'd like to be able to build this reflection directly into the table lookup as per Section 11, but for whatever reason, I'm having some difficulty. -Dave -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads