2025-04-25 10:02 AM
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.
2025-04-28 2:02 AM
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.