ms45xx driver : how to read 0 byte

Discussions and support about ChibiOS/EX, the External Peripherals Abstraction Layer.
Post Reply
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

ms45xx driver : how to read 0 byte

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ms45xx driver : how to read 0 byte

Post by Giovanni »

Hi,

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

Giovanni
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

Re: ms45xx driver : how to read 0 byte

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ms45xx driver : how to read 0 byte

Post by Giovanni »

I think also the LLD is impacted, I am not even sure the STM32 I2C can do that.

Giovanni
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

Re: ms45xx driver : how to read 0 byte

Post by alex31 »

Yes, some sensors makers have very strange idea sometimes to simplify their silicon design ...
Post Reply