How to resolve SPI/I2C conflict in H3LIS100DL/IIS2DLP - shared bus with external flash?
Greetings. I am sharing a SPI bus between a H3LIS100DL, a IIS2DLP and an external flash chip. When communicating with external flash, I get corrupted bytes after certain byte sequences. I’ve chased the issue down to the fact that these two accelerometers have optionally i2c and SPI communication capabilities – and this capability is enabled using the chip select line (high = i2c, low = SPI). Of course, since this is a shared bus, we need to assert the chip select line on devices we are not communicating to (via SPI) – which, in the case of these accelerometers, means they are in i2c mode. It seems that the accelerometers are misinterpreting SPI commands as i2c commands, they then respond (talking over the SDA line – which happens to also be the MOSI line), and this response corrupts the SPI data.
The specific SPI byte sequences that create the issue just so happen to align with the i2c addresses of the parts – not too surprising.
Besides moving the accelerometers to an unshared SPI bus, is there a recommended method to avoid this problem? The IIS2DLP has a register setting which disables the i2c interface – however we’ve found that this does not resolve the problem (even with the H3LIS100DL disconnected from the bus). The H3LIS100DL does not have such a register setting.
