cancel
Showing results for 
Search instead for 
Did you mean: 

CS behavior for LPS22HH

ELask.1
Associate II

Hello,

We are using LPS22HH in SPI mode in our project.

It seems that tying nCS =0 (not toggling it) disables SPI communication altogether.

Is this observation correct?

Does the nCS signal need to be toggled (asserted-deasserted) in order to trigger some internal state machine that enables communication?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Community member​ ,

please note that your "Scenario n.1" is very similar to "Scenario n.2" in most cases, since a floating pad voltage value is often close to 0V, mostly depending on the surrounding electrical environment.

The third scenario, i.e. nCS pad transition from Vdd to GND, followed by the clock activation, is the requested one. This is valid in general for the SPI communication, and explicitly for ST sensors, since it is the trigger for the ASIC internal SPI state machine, as suggested by yourself.

Please note that usually ST sensors run in SPI Mode 3, as depicted here below:

0693W000004JpCWQA0.png 

-Eleon

View solution in original post

5 REPLIES 5
Eleon BORLINI
ST Employee

Hi @Community member​ ,

the SPI communication starts after transition high to low of the CS pin, as you can see in the datasheet, p 29.

0693W000004JmQfQAK.pngAre you keeping the CS pin low all time before starting the SPI communication? If no, you correctly have to "toggle" the pin (asserted-deasserted) as already suggested by you.

-Eleon

Hi @Eleon BORLINI​ , thanks for your prompt response.

We have tested 2 scenarios:

  1. nCS asserted (=0) at all times - communication failed
  2. nCS floats (hi-Z) when deasserted and 0 when asserted - still no communication

I guess that a 3rd scenario works as depicted in the datasheet but my question is whether scenario 1 should/can work as well (as we have some hardware constarints) ??

Thanks

Hi @Community member​ ,

please note that your "Scenario n.1" is very similar to "Scenario n.2" in most cases, since a floating pad voltage value is often close to 0V, mostly depending on the surrounding electrical environment.

The third scenario, i.e. nCS pad transition from Vdd to GND, followed by the clock activation, is the requested one. This is valid in general for the SPI communication, and explicitly for ST sensors, since it is the trigger for the ASIC internal SPI state machine, as suggested by yourself.

Please note that usually ST sensors run in SPI Mode 3, as depicted here below:

0693W000004JpCWQA0.png 

-Eleon

Eleon BORLINI
ST Employee

Hi @Community member​ ,

were you able to test the "3rd scenario" (nCS toggled), or do you ave hardware constrains at app level?

-Eleon

Hi @Eleon BORLINI​ 

We did (though had to rework the hardware) and it works.

Thanks