Page 1 of 1

ms45xx driver : how to read 0 byte

Posted: Sat Aug 20, 2016 6:12 pm
by alex31
Hello,

I am implementing an i2c driver for the ms45xx pressure sensors family.

The method to trigger a new measure consists of reading 0 bytes (start;address;ack;stop)
ms45xx i2c protocol
but the chibios driver forbid this behavior,
what's the best solution to do this ?

ps : reading actual values does not trigger measure, so the trick that i tried first : discard the first measure does not work

Alexandre

Re: ms45xx driver : how to read 0 byte

Posted: Sun Aug 21, 2016 4:01 pm
by Giovanni
Hi,

I think the I2C driver requires a change for that, are you sure it is the only way?

Giovanni

Re: ms45xx driver : how to read 0 byte

Posted: Sun Aug 21, 2016 8:21 pm
by alex31
Hi,

For now, i didn't found a workaround, but i will try to send the first command by bitbanging, then see if the
READ_MR command (the 0 byte one) has to be sent only once at the begining, or at each measure. If it's only once at the beginning, i can
afford to bitbang this command. If I have to send it at each measure (100hz), the bitbang trick won't do the job since i have two others sensors on this bus, and switch from i2c to bitbang will ruin the bandwith.

About the driver change in chibios, it's just about to not verify zero length in the assert, or is there more to modify ?

Alexandre

Re: ms45xx driver : how to read 0 byte

Posted: Sun Aug 21, 2016 8:28 pm
by Giovanni
I think also the LLD is impacted, I am not even sure the STM32 I2C can do that.

Giovanni

Re: ms45xx driver : how to read 0 byte

Posted: Sun Aug 21, 2016 9:22 pm
by alex31
Yes, some sensors makers have very strange idea sometimes to simplify their silicon design ...