Dallas DS18B20 CRC

Hi everybody.

I've got a problem using Dallas DS18s20 temperature sensor. In particular, it seems to me it sends a wrong crc.

Here's how I use it. Firstly, I perform a temperature conversion, and a second later I read data stored in its scratchpad. Data regarding temperature and fixed values seems correct (temperature is correct, the other parameters are always the same), but the crc is wrong.

What can I do to solve the problem?

Thanks,

Max

Reply to
suppamax
Loading thread data ...

Max,

How are you determining that the CRC is incorrect? Is it possible that the bus master is incorrectly calculating what the CRC should be?

Hard to say much else without more information. What hardware are you using (microcontroller/microprocessor), how are you calculating CRC, etc? There is apretty good writeup in the datasheet and Dallas (now Maxim) application note AN27 covers CRC quite thoroughly.

Good luck, Richard

Reply to
Richard Seriani

I see, I didn't give you a lot of informations.

My micro reads correctly data from the bus, I've verified it using an oscilloscope.

The micro also calculates the CRC correclty, I've verified it using an online crc calculator.

Another trial for that is I always receive default data from DS18s20 correctly.

I have no idea about how to solve this bug...

Max

Reply to
suppamax

Another thing I noticed is this one. For some couples (temperature, counts remaining) I always receive a wrong CRC, while when "counts remaining" is one unit less, the crc is correct. For example

Temperature - LSB = 0xA3 Temperature - MSB = 0x01 TH = 0x4B TL = 0x46 configuration register = 0x7F reserved = 0xFF counts remaining = 0x0D

Reply to
suppamax

Well, you have certainly minimized your help by avoiding quoting any earlier correspondence. If you want to post a followup via groups.google.com, ensure you quote enough for the article to make sense. Google is only an interface to Usenet; it's not Usenet itself. Don't assume your readers can, or ever will, see any previous articles. More details at:

--
 [mail]: Chuck F (cbfalconer at maineline dot net) 
 [page]: 
            Try the download section.
Reply to
CBFalconer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.