Hi, it looks like this kind of question has been asked quite a few times already, but I still have to do it again. Why my HDC2080 is returning invalid values?
I am trying to use it in "on demand" mode like this:
//After device boots up, reset sensor
[00:00:10.205,108] <dbg> i2c: Write: 0e 80
//Wait for 3ms and write all zeros to 0x0E(Auto disabled, heater off, no int)
[00:00:10.208,587] <dbg> i2c: Write: 0e 00
//Write all zeros to 0x0F, not sure what the purpose of this is, but programming guide says to do this. No effect on the problem
[00:00:10.209,014] <dbg> i2c: Write: 0f 00
// Enable data ready interrupt/flag
[00:00:10.209,411] <dbg> i2c: Write: 07 80
// Then, every time I want to make a measurement I do this(a loop starts here)
// Start command
[00:00:10.209,869] <dbg> i2c: Write: 0f 01
// After 2ms(time 2-100ms does not affect to results) read data
[00:00:10.213,378] <dbg> i2c: RW(W): 00
[00:00:10.214,202] <dbg> i2c: RW(R): d8 61 fe ff
[00:00:10.214,233] <inf> hdc2080: Measured temperature: 23.06
[00:00:10.214,233] <inf> hdc2080: Measured humidity: 99.99
// Results are rubbish. Results are sometimes sane, but usually humidity is FFFF or FEFF
// Also temperature is about 2 degrees higher than what it is when the measurement actually works
I have tried to use the auto mode and tried all sane and insane timings that I can think of, but no luck. I also tried to dump the whole 16 bytes of registers in every step. Then I noticed this:
// Register dump after reset command. Register 0x04 is not at 0x00 what it says in data sheet.
// Register 0x0F is also not 0x00
00 00 00 00 28 00 00 00 00 00 00 ff 00 ff 00 f6
// After the init I describe above, everything is what I except them to be
00 00 00 00 00 00 00 80 00 00 00 ff 00 ff 00 00
// After Start command, still ok
00 00 00 00 00 00 00 80 00 00 00 ff 00 ff 00 00
// After sleeping for 2ms
// Interrupt at 0x04 tells that data is ready, data in temp&hum registers is f1 61 01 00
// And also 0x05 and 0x06 have changed?
f1 61 01 00 10 61 00 80 00 00 00 ff 00 ff 00 00
// If I read them again immediately Data ready bit is cleared as expected, but humidity changed to FFFF,
f1 61 ff ff 00 61 00 80 00 00 00 ff 00 ff 00 00
// In a loop after this first reading(10s from last I2C communication above) registers are otherwise unchanged
// but 0x06 has again mysteriously changed (0x00->0xFF)
// Before next start command
f1 61 ff ff 00 61 ff 80 00 00 00 ff 00 ff 00 00
// After start command and 2ms sleep, data again ready, both temp and hum have changed, but they are still rubbish
ec 61 fe ff 10 61 ff 80 00 00 00 ff 00 ff 00 00
Any hints what to test or try next? I have used this sensor in other HWs succesfully and never having these kind of problems. So it might be something HW related.
-Jussi-