0
\$\begingroup\$

I am trying to use the LSM6DSOX IMU sensor which has both an SPI and an I2C interface which are mapped to the same pins. I want to address the IC using its SPI interface

(Datasheet for reference)

In the datasheet the following is said:

The serial interfaces are mapped onto the same pins. To select/exploit the I²C interface, the CS line must be tied high (i.e connected to Vdd_IO).

Wouldn't that mean that while the this IC is not selected that it is in I2C mode. Couldn't this result in this IC being accidentally addressed due to another IC being addressed on the same SPI BUS which happens to be receiving a command which corresponds to the LSM6DSOXs I2C address?

\$\endgroup\$
2
  • \$\begingroup\$ Do you really want to mix protocols on the same wires rather than just picking one protocol for that bus and sticking with it? Why would you want to do that? \$\endgroup\$ May 12, 2023 at 15:35
  • 1
    \$\begingroup\$ @SpehroPefhany I do not want to mix protocols which is the problem. The IC has both interfaces mapped to the same pins and if I understand the datasheet correctly setting chip select high will cause I2C to be enabled \$\endgroup\$
    – Reewen
    May 12, 2023 at 15:42

2 Answers 2

2
\$\begingroup\$

The chip will start up with all interfaces enabled and listen to I2C bus protocol when SPI chip select is high and will listen to SPI bus protocol when SPI chip select is low.

When the chip has been powered up, you can configure it via SPI to not to listen to I2C protocol when SPI chip select is high.

That way any SPI transactions to other chips will not be interpreted falsely as I2C transactions.

\$\endgroup\$
0
\$\begingroup\$

It does a one-time measurement at startup, before the pins are configured as communication interface at all.

\$\endgroup\$
2
  • \$\begingroup\$ No it doesn't. The datasheet does not say it does. Maybe some other chip works like you describe, but not this. \$\endgroup\$
    – Justme
    May 12, 2023 at 15:31
  • \$\begingroup\$ You are right, I assumed. Bootstrapping pins is pretty common practice... Truth is, unless the datasheet is pretty transparent on the subject, it's hard to say for sure how the black box works. \$\endgroup\$
    – vicatcu
    May 13, 2023 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.