I2C sensor with additional CS/power pins

Hello,

I am trying to use LPS22HB sensor on a custom NRF52832 board. The sensor shall be supported by Zephyr/NRF Connect (in I2C mode) - but the driver continously reports False via device_is_ready().

The sensor is dual-mode and supports SPI as well. To configure it for I2C, CS pin has to be set to HIGH (as well as SDO/SAO - set a desired I2C bus address 5C or 5D). On this particular board both CS and SAO are wired to GPIO pins on a controller - so I need to set them properly (and probably wait until everything settles up) before accessing I2C. Unfortunately, initialisation of a sensor driver seems to happen before main() - so it seems to hit inactive device and fail.

Please advise - how can I resolve this (using SDK 2.4.0).

Thanks!

Parents
  • Hi

    What GPIOs are you using from the nRF52832 to connect to the LPS22hB sensor? And are you certain that the sensor is powered at all? Do you have a logic analyzer or similar to see if there's any activity at all between the nRF52 and the LPS22HB?

    Best regards,

    Simon

  • Unfortunately - I do not have an analyzer. 

    SDA is P0.29, SCL is P0.02.
    CS (which has to be "1" for I2C) - wired to P0.03 without any external pull. SA0 - wired to P0.28 the same way. 

    My question relates to a "by the book" scenario - before dealing with potential issues, what is the correct way to set CS and SA0 to the expected state before Zephyr Lps22hb driver will try to access the device as a part of its initialisation?

    From the power perspective - the sensor is hardwired to a Vcc/Gnd. 

Reply
  • Unfortunately - I do not have an analyzer. 

    SDA is P0.29, SCL is P0.02.
    CS (which has to be "1" for I2C) - wired to P0.03 without any external pull. SA0 - wired to P0.28 the same way. 

    My question relates to a "by the book" scenario - before dealing with potential issues, what is the correct way to set CS and SA0 to the expected state before Zephyr Lps22hb driver will try to access the device as a part of its initialisation?

    From the power perspective - the sensor is hardwired to a Vcc/Gnd. 

Children
No Data
Related