cancel
Showing results for 
Search instead for 
Did you mean: 

Interface 4 wire spi with ILPS22QS

marco_pontin
Associate

Hello,

I am developing an application that uses 8 ILPS22QS in 3-wire mode and a microcontroller that does not support this mode natively. A shift register is used to control the CS lines and it is working as expected.

I tried to go around this problem by wiring the SPI as per the diagram attached.

I am using the Arduino IDE and the SPI library.

After enabling the SPI at a speed of 100000Hz (and set to MODE 3), I pull the first sensor CS pin low and immediately write to address 0x0E the value 0x60.

After that I try to read back the same register (SPI.trasfer(0x8E)) and register 0x0F, but the chip does not respond. During the "reading back" part of the transaction, I tried sending either 0xFF or 0x00 on the MOSI, but the result is the same, on the MISO I just get a copy of whatever the MOSI is sending.

I have also tried changing the 2.7k resistor between the MOSI and MISO pin for a 5k, but nothing changed.

I have attached the full arduino code too, just in case (to test it, remove .txt extension).

Am I missing something? Any help is greatly appreciated!

 

1 REPLY 1
Federica Bossi
ST Employee

Hi @marco_pontin ,

Since your microcontroller do not support natively SPI 3 wires, do you check that its MOSI do not force the line also during reading transaction? 

Otherwise sensor cannot reply neither on MISO.

 

Have you tried your flow starting with a single sensor?

Do you write the configuration to communicate in SPI to all sensors before starting your procedure?

 

What should be used for SPI.transfer(0xFF)? Are you reading register 0x7F? 

ILPS22QS registers stops at 0x7A.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.