ms45xx driver : how to read 0 byte

Discussions and support about ChibiOS/EX, the External Peripherals Abstraction Layer.
User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

ms45xx driver : how to read 0 byte

Postby alex31 » Sat Aug 20, 2016 6:12 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: ms45xx driver : how to read 0 byte

Postby Giovanni » Sun Aug 21, 2016 4:01 pm

Hi,

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

Giovanni

User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

Re: ms45xx driver : how to read 0 byte

Postby alex31 » Sun Aug 21, 2016 8:21 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: ms45xx driver : how to read 0 byte

Postby Giovanni » Sun Aug 21, 2016 8:28 pm

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

Giovanni

User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

Re: ms45xx driver : how to read 0 byte

Postby alex31 » Sun Aug 21, 2016 9:22 pm

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


Return to “ChibiOS/EX”

Who is online

Users browsing this forum: No registered users and 3 guests