cancel
Showing results for 
Search instead for 
Did you mean: 

ISM330DHCX temperature reading?

pedro_uno
Associate

Hello,

We have the ISM330DHCX designed into a new product but I am having trouble getting reliable readings using the I2C interface. I am able to read the WHOAMI register and get 0x6B but OUT_TEMP_L (20h), OUT_TEMP_H (21h) always return zero.

I have the interface instrumented and I can see that the signalling is correct, with repeated start and everything, but only zeros.

Does anyone have a suggestion of how this is happening?  Do I need to do something special to enable temperature readings?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Federica Bossi
ST Employee

Hi @pedro_uno ,

Your I2C interface is working correctly since you can read the WHOAMI register.

The ISM330DHCX temperature sensor output registers (OUT_TEMP_L/H) will return zero unless the accelerometer or gyroscope is enabled (ODR ≠ power-down).

Set the ODR of either sensor to a valid value, wait for the sensor to update, and then read the temperature registers.

 

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.

View solution in original post

3 REPLIES 3
Peter BENSCH
ST Employee

Welcome @pedro_uno, to the community!

Please check STATUS_REG.TDA.

The temperature sensor does not need a special enable sequence, but OUT_TEMP_L/H will only update once valid temperature data is available. Also make sure:

  • CTRL4_C.I2C_disable = 0
  • CTRL9_XL.DEVICE_CONF = 1
  • you wait after power-up/reset before reading, e.g. 1ms

If TDA = 0, the temperature registers may still read as zero.

Hope that helps?

Regards
/Peter

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.

For now I have the processor in a loop that reads the ISM330DHCX once per second. 

You can see that I succeed to read the WHOAMI register. 

STATUS_REG always returns 0x00, TDA not true. 

I read back the CTRL9_XL register and it says I have the DEVICE_CONF bit set.

I2C is enabled by default and I am using I2C to access these registers.  

What else can prevent the part from reporting temperature?

whilecount: 58
gyro_whoami = 0x6B
gyro status = 0x00
CTRL9_XL = 0x02
gyro_temperature = 0x0000
gyro_temperature = 25.000

whilecount: 59
gyro_whoami = 0x6B
gyro status = 0x00
CTRL9_XL = 0x02
gyro_temperature = 0x0000
gyro_temperature = 25.000

 

Federica Bossi
ST Employee

Hi @pedro_uno ,

Your I2C interface is working correctly since you can read the WHOAMI register.

The ISM330DHCX temperature sensor output registers (OUT_TEMP_L/H) will return zero unless the accelerometer or gyroscope is enabled (ODR ≠ power-down).

Set the ODR of either sensor to a valid value, wait for the sensor to update, and then read the temperature registers.

 

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.