Skip to main content
Associate
August 1, 2024
Question

L3GD20 and 072B-DISCO

  • August 1, 2024
  • 2 replies
  • 931 views

I want to use the L3GD20 gyroscope on my development board. But I didn't understand what I should do and I couldn't find an example on the internet. I know it communicates via SPI, but I could not send or read data. Can you please help me in detail? 

BNP_0-1722525903040.png

 

2 replies

TDK
Super User
August 1, 2024

There is no L3GD20 on that board from what I can tell by the user manual. Do you mean the I3G4250D? Or are you working with an external board with a L3GD20 on it?

"If you feel a post has answered your question, please click ""Accept as Solution""."
BNPAuthor
Associate
August 2, 2024

Sorry, you are right I mean I3G4250D.  I figured out the problem, the problem was 

hspi2.Init.DataSize = SPI_DATASIZE_8BIT;

SPI_DATASIZE_8BIT was the 4BIT I changed it now I can read the WHO_AM_I value but now I can't read the XYZ axis values. I can get some values but values don't change when I move the sensor.

 

 

TDK
Super User
August 2, 2024

If you can read WHO_AM_I, that confirms the sensor is hooked up and communicating correctly. You are probably not setting up the chip correctly to do more measurements.

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