-------------------------------------------------- From: "Bob Ammerman" Sent: Friday, September 17, 2010 2:11 AM To: "Microcontroller discussion list - Public." Subject: Re: [EE] CRC for Maxim temp sensor DS18B20 >> -------------------------------------------------- >> From: "Bob Ammerman" >> Sent: Friday, September 17, 2010 12:46 AM >> To: "Microcontroller discussion list - Public." >> Subject: Re: [EE] CRC for Maxim temp sensor DS18B20 >> >>>>I am trying to calculate the CRC for a DS18B20 sensor (the one used in >>>>the >>>> temp logger project I posted about recently) >>>> >>> >>> Check to see if your value is the bit-reversal of the correct value. In >>> other words if, for example, the correct CRC is >>> >>> 0x12 =3D 0b00010010 >>> >>> Is your CRC computed as: >>> >>> 0x48 =3D 0b01001000 >>> >>> Sometimes the high-level language (or excel!) algorithm gets the bits >>> flipped end-for-end relative to the hardware. >> >> Thanks for the reply. >> I have tried all sorts of variations on the above, inverting, reversing, >> swapping nibbles etc etc, but none of them work. > > Have you tried preloading the CRC value with all one bits? Yes, I think I did try that in my C version, though IIRC it states in one o= f=20 the app notes that it starts off with all 0s in the shift register. No reply from Maxim yet on the subject.=20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .