Skip to main content
Explorer
August 27, 2025
Solved

LSM6DS3 SPI Bug?

  • August 27, 2025
  • 2 replies
  • 638 views

Hello, I use an AT32F403A MCU to connect LSM6DS3 IMU via SPI 4-wire, then I read the WHO_AM_I register at 0x0F. According to the datasheet, the return value should be 0x69, but the chip returned 0x44. Then I repowered the board, and the value seemed to change to 0x7F. Then I read the Acc and Gyro data. From the logic analyzer, there seem to be some abnormal glitches, which looks like some connection problems, but I checked the wiring and I can't find the problem. Can somebody help me figure out the problem? Thank you.

Wakkk_0-1756302516517.pngWakkk_1-1756302521207.pngWakkk_2-1756302530679.png

 

    This topic has been closed for replies.
    Best answer by Federica Bossi

    Hi @Wakkk ,

    Yes, the symptoms you describe strongly suggest communication issues between your AT32F403A MCU and the LSM6DS3 sensor.

    MOSI, MISO, SCLK, CS lines correctly connected? Did you follow the datasheet?

    Start with a low SPI clock (e.g., 1 MHz) to ensure signal integrity, then increase if stable. Ensure CS is properly driven low before and high after each SPI transaction.

    2 replies

    Technical Moderator
    August 28, 2025

    Hi @Wakkk ,

    Yes, the symptoms you describe strongly suggest communication issues between your AT32F403A MCU and the LSM6DS3 sensor.

    MOSI, MISO, SCLK, CS lines correctly connected? Did you follow the datasheet?

    Start with a low SPI clock (e.g., 1 MHz) to ensure signal integrity, then increase if stable. Ensure CS is properly driven low before and high after each SPI transaction.

    Super User
    August 28, 2025

    In addition to what @Federica Bossi already said,

     


    @Wakkk wrote:

     From the logic analyzer, there seem to be some abnormal glitches,


    Have you used an oscilloscope to see what's happening in the analogue domain?

    eg, noise, ringing, unstable levels, sloppy edges, etc ...

     


    @Wakkk wrote:

    which looks like some connection problems,


    Might also be bad decoupling?

     


    @Wakkk wrote:

     I checked the wiring and I can't find the problem. Can somebody help me figure out the problem?


    We can't see you hardware, so we can't check it, or comment on it.

    You need to show the schematics & layout.

    Also some good, clear photographs.

    See: How to write your question to maximize your chances to find a solution.