cancel
Showing results for 
Search instead for 
Did you mean: 

How to use SPI with gyroscope I3G4250D in the kit STM32F411 Discovery

duoc_ngo261
Associate II

Hi, 

In the datasheet of the gyroscope I3G4250D, page 21:

CS: 0: SPI communication mode / I2C disabled

duoc_ngo261_0-1767429026047.png

My question is: I have to configure the CS pin PE3 as Low at the beginning to make the gyroscope understands that I wants to use SPI? (PE3 is CS in the KIT STM32F411 Discovery)

 

duoc_ngo261_1-1767429106880.png

 

Wating for your response,

Thank you very much.

 

3 REPLIES 3
TDK
Super User

> I have to configure the CS pin PE3 as Low at the beginning to make the gyroscope understands that I wants to use SPI?

Yes.

Also be aware that the chip is in I2C mode when the pin is high, which can cause issues if your signals look like valid I2C signals. If you're only using the bus for this chip, no issues.

If you feel a post has answered your question, please click "Accept as Solution".

Hi,

I configured the CS pin PE3 as Low at the beginning and High at the beginning. In both cases, the sensor works. Should I  configure the CS pin PE3 as Low at the beginning or High at the beginning? (I want to use SPI). Do you know the mechanism that the sensor detects that we use SPI or I2C? The datasheet of the sensor is not clear at this point.

Thank you very much

The datasheet says CS must be low for SPI transactions. When it is high, SPI is idle.

If you feel a post has answered your question, please click "Accept as Solution".