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
ms45xx driver : how to read 0 byte
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: ms45xx driver : how to read 0 byte
Hi,
I think the I2C driver requires a change for that, are you sure it is the only way?
Giovanni
I think the I2C driver requires a change for that, are you sure it is the only way?
Giovanni
- alex31
- Posts: 379
- Joined: Fri May 25, 2012 10:23 am
- Location: toulouse, france
- Has thanked: 38 times
- Been thanked: 62 times
- Contact:
Re: ms45xx driver : how to read 0 byte
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
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
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: ms45xx driver : how to read 0 byte
I think also the LLD is impacted, I am not even sure the STM32 I2C can do that.
Giovanni
Giovanni
- alex31
- Posts: 379
- Joined: Fri May 25, 2012 10:23 am
- Location: toulouse, france
- Has thanked: 38 times
- Been thanked: 62 times
- Contact:
Re: ms45xx driver : how to read 0 byte
Yes, some sensors makers have very strange idea sometimes to simplify their silicon design ...
Who is online
Users browsing this forum: No registered users and 25 guests