I'm working on a project using a honeywell HSC pressure transducer hooked up on the i2c bus. This project also has a DS1307 RTC, a BMP085, and an 8-ch 12-bit i2C ADC. The hex address of the HSC is 56, and I don't think there's any overlap there.
I'm writing everything to an SD card, and my numbers seem to be correct, except for the HSC.
I get a repeating value of 100010110111, which according to their datasheet (Safety and Productivity Solutions | Honeywell) means that;
- The data is 'Stale Data," which they say means data that has not been updated since the last time I got it (the first two bits are the status bit which are 10 in this case,) and,
- That it's currently got -5.55047 psig applied to it (The transfer function says p = (counts-countsmin)*(pmax-pmin)/(countsmax-countsmin), so counts = 183, and it's a 0-50psig with a 10-90% calibration.)
Unless I'm reading the datasheet completely wrong that is. It's currently open to atmosphere so I find it hard to believe it's got 5 pounds of negative pressure on it, but that's just me.
Here's the function where I get the values,
String getLinePressure()
{
String dataString = "";
byte pvalHigh, pvalLow;
Wire.requestFrom(PRESSURE_ADDRESS, 2);
while (Wire.available()) {
pvalHigh = Wire.receive();
pvalLow = Wire.receive();
}
dataString += ",";
dataString += String(pvalHigh, BIN);
dataString += String(pvalLow, BIN);
return dataString;
}
And I call it once per second in my main(), which tells me I've really got something screwed up because once a second should be more than okay for the pressure transfer, or do I need a wait in the actual function?
Also, I wrote a bit of code to just grab the bits and if you examine them independently the high value is 1000 and the low value is 10110111, so apparently I'm losing four bits from the high value too.
Any help you guys could give me would be appreciated, thanks.
-Ian