2021-04-22 03:10 AM
I want to read LIS2DTW12 data using SPI which is also shared with another device, can I use the LIS2DTW12 CS pin as chip select and operate devices one by one.
because according to the LIS2DTW12 datasheet:
State of CS
1: SPI idle mode / I²C communication enabled;
0: SPI communication mode / I²C disabled
i.e if cs = 1 --> I2C Enabled, read/write operation on another device will disturb the LIS2DTW12 device.
Solved! Go to Solution.
2021-04-22 05:40 AM
Hi @Aishwarya ,
yes you can do it, since the SPI and I2C protocol are different, and you should not arise crosstalk effects.
However, to be sure you have no issues, in order to disable the I²C block you can set the CTRL2 (21h) (I2C_DISABLE) = 1 bit before you start your acquisition (see also p.37 of the datasheet for more info).
If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster.
-Eleon
2021-04-22 05:40 AM
Hi @Aishwarya ,
yes you can do it, since the SPI and I2C protocol are different, and you should not arise crosstalk effects.
However, to be sure you have no issues, in order to disable the I²C block you can set the CTRL2 (21h) (I2C_DISABLE) = 1 bit before you start your acquisition (see also p.37 of the datasheet for more info).
If my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster.
-Eleon
2021-04-22 06:08 AM
thanks @Eleon BORLINI