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

Karl Denninger karl at denninger.net
Wed May 8 19:06:05 UTC 2019


On 5/3/2019 06: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.

I don't know if you can do it with that utility, but coding up a simple
(~10-15 lines of "C") that reads two bytes is trivially easy.

You simply stuff a message buffer requesting 2 bytes in response and
call ioctl; you get back two bytes.

-- 
Karl Denninger
karl at denninger.net <mailto:karl at denninger.net>
/The Market Ticker/
/[S/MIME encrypted email preferred]/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4897 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20190508/4ec6168c/attachment.bin>


More information about the freebsd-arm mailing list