Skip to main content
william.le-coz
Associate
October 9, 2019
Question

How to interface LP22HB in SPI?

I'm using with cubemx the additional sotfware X-CUBE_MEMS1 with Terminal data logger and chose the mems LP22HB on a nucleo F401RE.

When I do it in I2C it's working fine.

No I configure the LP22HB in SPI with CS on GND. And connect for SPI. I configurate the SPI1 with pull-up on SCL,Clock Polarity HIGH,Clock phase 2 Edge, prescaler 32.

But no communication!

I see the clock at the beggining but nothing on MOSI or MISO on a scope.

I join the project!

Can you help me

    This topic has been closed for replies.

    2 replies

    Eleon BORLINI
    ST Employee
    October 9, 2019

    Hi @william.le-coz​ , but is your CS fixed to GND? Please note that for the SPI communication, the transition high to low of the CS pin is required.

    0690X00000ApMtKQAV.png

    Regards

    william.le-coz
    Associate
    October 14, 2019

    Thanks, it's working now :smiling_face_with_smiling_eyes: !

    I use CS with pull-up and MISO and MOSI with Pull-down.