LSP22HB having trouble with ONE-SHOT mode
I am using the LSP22HB on an I2C bus. I can read the "who am i" register and get the expected value. I can also read various configuration registers and see the default values. So, I believe I am communicating with the device.
I don't set any registers since it seems the default values have the device in power down mode which is needed for ONE_SHOT operation. To get the pressure and temperature values I do the following steps:
1. Write to CTRL_REG2 the value 0x11. This sets the IF_AUTO_INC and the ONE_SHOT bits. I am under the impression the ONE_SHOT bit starts the operation to get the pressure and temperature.
2. I loop on reading the CTRL_REG2 and check the ONE_SHOT bit waiting for it to go to zero. This should indicate that the readings are now available.
3. I then read the pressure and temperature registers. I get values but they are not correct. I have tried both multi-register access to get all the values in one I2C interaction and looping through and just getting one pressure and temperature register at a time. Neither seems to give reasonable date.
What am I doing wrong in using the ONE_SHOT mode?
Is there sample code that uses ONE_SHOT mode available?
Ancilliary information:
1. The T_DA and P_DA bits in the STATUS register which are supposed to indicate valid measurements are available never go to 1.
2. I did at one time have this setup using FIFO's and got reasonable values. However, I don't need all that information. It is more important to use less power and get the values every once in a while, like once a minute. Getting values every second or faster just isn't needed here and saving power is more important
Thanks
Chris
