cancel
Showing results for 
Search instead for 
Did you mean: 

How to interface LP22HB in SPI?

william.le-coz
Associate

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

2 REPLIES 2
Eleon BORLINI
ST Employee

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

Thanks, it's working now 😊 !

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