FreeBsd I2C utility gives same value as MSB and LSB from DS75 sensor 16bit register.

Per Hedeland per at hedeland.org
Sat May 4 11:05:57 UTC 2019


On 2019-05-03 13:43, Prasad M wrote:
> Hi Folks,
> 
> I am trying to access a DS75 I2C temperature sensor. It kind of works with
> the default i2c utility. But it returns twice the high byte instead of the
> high and low byte for the temperature. Probably because it does 1 byte
> reads on the I2C bus, sending a stop condition after every byte.
> 
> The device expects continuous reads and no stop/start in between the 2
> bytes. Trying all options i2c, most notably the -m mode switch, yields the
> same results all the time. Looking at the code in i2c.c
> 
> Could any one help to solve this problem with working I2CRDWR utility.

Hm, it's not entirely clear to me what you're asking for, but if it is
a variant of i2c(8) that uses the I2CRDWR ioctl for data transfers,
you can find one at https://github.com/vzaigrin/newi2c - note the
comments/caveats though. FWIW, it worked fine for me when figuring out
the ads1015 AD converter (after which I wrote my own "dedicated" code
for that, using I2CRDWR).

--Per


More information about the freebsd-arm mailing list