LM75 race condition

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LM75 race condition

2,334件の閲覧回数
unglaublich
Contributor I

Working with a LM75B, I2C temperature sensor.

 

The situation is fairly simple: I read the Temperature data, a 2 byte register. Most of the time, this works fine.

However, when the temperature is around one full degree, the sensor seems to jump up and down a whole degree: that's incidentally the resolution of the first byte of temperature data... 

It seems that the register value of the temperature register changes during the read-out of the data!

Now, after some investigating, I acquired the I2C data from the bus. I get these results:

Byte 1 Byte 2 Calculated Temp.

0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0x00 30.00
0x1f 0x00 31.00
0x1f 0x00 31.00
0x1f 0x00 31.00
0x1f 0xe0 31.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0x00 30.00
0x1f 0x00 31.00
0x1f 0x00 31.00

The real temperature is about 31'C.

Do you have any idea what is going on here and whether this is as intended?

Above are the first 50 samples of sensor 0x49.

unglaublich_0-1601293021871.png

Typical readout:

unglaublich_1-1601293036625.png

 

 

0 件の賞賛
返信
3 返答(返信)

2,296件の閲覧回数
microdynamics
Contributor II

1. read the 16-bit sensor data twice.

2. if the two high bytes are same, take the second data as new value

   else read the 16-bit sensor data again and take that one as new value.

3. end of procedure

0 件の賞賛
返信

2,310件の閲覧回数
unglaublich
Contributor I

Well, my hacky solution for now is to check whether the current value is more than 0.5 deg. C off from the previous value (i.e. in 10ms), if so, I bring the new value back 1.0 deg. C to the previous value.

This solved the problem in all observable situations.

Note that this is a software hack to a hardware issue.

0 件の賞賛
返信

2,169件の閲覧回数
JPT
Contributor I

Same problem seen, also new parts from UK stockist show the same error.

Any known fix?

Not practical to do repeated reads in my application.

 

0 件の賞賛
返信