Skip to main content
Visitor II
August 1, 2024
Question

L3GD20 and 072B-DISCO

  • August 1, 2024
  • 2 replies
  • 930 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

 

    This topic has been closed for replies.

    2 replies

    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?

    BNPAuthor
    Visitor II
    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.

     

     

    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.