cancel
Showing results for 
Search instead for 
Did you mean: 

Unresponsive LPS22HHTR

boof
Associate

Hi all,

 

I have installed the LPS22HHTR on my custom circuit to communicate with a STM32F4x via I2C. I have pulled up the SCL (pin 2), SDA (pin 4), SA0 (pin 5), and CS (pin 6) lines to 3.3V via 4.7k resistors, grounded the two ground pins (8 and 9) and RES (pin 3). I have also provided a 100nF decoupling capacitor for the VDD and Vdd_IO pins and left INT_DRDY floating.

 

My issue right now is that when i try to call on the device using its address (0b1011101 << 1) and the HAL_I2C_IsDeviceReady() function, I am not getting a response and a NACK is thrown (I2C_FLAG_ADDR = RESET and I2C_FLAG_AF = SET). I have double checked the configuration of the circuit several times and voltages at pins but I'm still not getting a response.

 

I would appreciate any help as to why this is happening or if I'm doing something wrong.

2 REPLIES 2
Federica Bossi
ST Employee

Hi @boof ,

I don't see any mistake in your custom circuit.

Ensure that the I2C peripheral is correctly initialized. Check the clock speed and ensure it matches the sensor's specifications (typically 100 kHz or 400 kHz).

HAL_I2C_IsDeviceReady() Function checks if the device is ready for communication. Make sure that the I2C handle is correctly configured and that the address passed to this function is correct (0x5D << 1).

Use an oscilloscope or logic analyzer to observe the I2C signals on the SDA and SCL lines. This can help identify if the signals are correctly formed and if there are any issues with the timing or signal integrity.

Let me know.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hello @Federica Bossi and hello @boof

I have exactly the same problem as boof. My design is a little bit different and not that sophisticated as boof's because I don't have pullups for SA0 (pin5) and CS (pin6), I just simply connected them to VDD, but I do have a 10k pullup for both SDA (pin4) and SCL (pin2).

My main uC is an STM32C011 and I have another sensor connected to the same I2C bus and it works perfectly only the LPS22HH is not communicating. I already assembled two (identical) boards and have exactly the same issue on both of them. I attached two scope captures (one with a working I2C sensor on the bus and one with LPS22) and PCB snapshot. (I know that my layout is not the nicest, I'm still learning it, and next time I'll not put the trace under the sensor, but I don't think that it matters much in this problem. :) ) The two 10k pullups for SDA and SCL are not shown on the snapshot and the passive component next to the chip is a 100 nF decoupling capacitor as suggested in the datasheet. On the snapshot the traces are marked as 3V0 and that will be the operating voltage in the final assembly but for now I'm using 3.3V for programming and testing.

I have checked the I2C timing as well and played with the delays (SCLDEL, SDADEL) and the clock shape (SCLH,SCLL) in the I2C_TIMINGR, but even that does not help, and even if I fully comply with the timing values show in Table 7. on page 12 in the LPS22 datasheet, it still only gives me NACK. I even tried with I2C address 0x5C just in case, but the results are always the same.

Can you please take a look at it and help me solve the issue?

Thank you!