2014-05-06 08:18 AM
I'm planning to use a LIS3DH on the same SPI bus as an EEPROM.
But in the datasheet it says the LIS3DH CS pin is selecting SPI or I2C.So is it possible to use SPI to the EEPROM when LIS3DH CS pin is high (the LIS3DH would be in I2C mode)?I don't think it would be ok, or? #cs #spi #lis2dh #lis2hh2014-06-06 01:59 PM
Possible. If you set both devices in spi mode then use spi mode. If you select i2c eeprom use both in i2c mode. Sharing the bus is common practice.
2015-10-21 07:02 AM
''So is it possible to use SPI to the EEPROM when LIS3DH CS pin is high (the LIS3DH would be in I2C mode)?''
NO, this will likely go badly for you (if it hasn't already). Several ST devices don't use the notion of Chip Select (CS) in a compatible manor with a shared SPI bus. When not selected, the CS is HIGH which also puts the device in I2C mode. Therefore if any data to you EEPROM happens to look like the LIS3DH's I2C slave address, it will drive the SDI line corrupting data to your EEPROM.I learned this the hardware and can no longer use these ST devices on a shared SPI bus.2016-02-19 12:36 AM
I agree to the concern that you have raised. Definitely it will fail if the I2C address is matched.
This LIS2HH chipset has CTRL4 register which can enable/disable the I2C module.So if i pull CS low and write to this CTRL4 to disable the I2C module then will this help avoid I2C working after CS is pulled HIGH?Can someone please confirm at earliet?Regards,Shriharsh Datar2016-02-23 12:12 PM
I'm not sure, but maybe a solution is to drive the Vdd_IO pin low when using the SPI bus to communicate with the EEPROM. It's up to someone from ST to answer if it's reasonable.
2016-07-06 12:13 AM
2016-07-08 08:03 AM
To use LIS3DH on shared SPI bus it is necessary to disable the I2C.
It can be done applying following sequence after each device power on.a = read(0x17)
write(0x17, (0x80 OR a))
Best regardsMiroslav2016-07-14 07:01 AM
We have a problem with the accelerometer LIS2DH12. You wrote that the installation of the 7th bits to the register 0x17 should disable the I2S module. This is exactly the work in LIS2DH12?
which means that the 1st bit in 0x00 register?2016-07-15 12:49 AM
My answer is also valid for LIS2DH12.
Set the 7th bit in register 0x17 to disable I2C.Best regardsMiroslav2016-08-16 06:30 AM
The suggested code is also given as a Note in the Data Sheet (I refer to the IIS328DQ Data Sheet - en.DM00150114.pdf).
However, the last sentence of the Note is misleading and shall be deleted: ''In this way, CTRL_REG4 is programmed to enhance the robustness of the SPI.'' The problem solved with that note has nothing to do with CTRL_REG4. As multi-slave SPI is common, the Note shall also be moved from the end of the section to the beginning (may be before Table 8. ''Serial interface pin description'').