Skip to main content
Visitor II
August 24, 2021
Solved

STSS22H No stretch one-shot timing

  • August 24, 2021
  • 4 replies
  • 1419 views

I want to readout the STSS22H, without any polling or I2C clock stretching. I want to use the following sequence:

  • Send soft reset command
  • Send one shot command
  • Release I2C bus for other processes to use
  • Wait for the maximum conversion time of the one-shot mode
  • Get the result
  • Release I2C bus for other processes to use
  • Wait for a couple seconds
  • Repeat from step 1

Is this possible with the STSS22H, where can I find the maximum conversion time in one **** mode? This information is missing in the datasheet.

    This topic has been closed for replies.
    Best answer by DSull.3

    Hi, the conversion time should depend from the ODR you set: the limit is 1Hz, so a complete conversion will take 1s. For higher ODRs, the conversion time will be lower (for example for ODR=25Hz the conversion time will be 1/25s = 40ms).

    \DK

    4 replies

    Visitor II
    August 24, 2021

    Does this help?

     0693W00000DqDvfQAF.png

    allardAuthor
    Visitor II
    August 25, 2021

    No, it's a bit vague, does it mean that the sampling takes around 1000ms, seems a bit long.

    DSull.3Answer
    Visitor II
    August 25, 2021

    Hi, the conversion time should depend from the ODR you set: the limit is 1Hz, so a complete conversion will take 1s. For higher ODRs, the conversion time will be lower (for example for ODR=25Hz the conversion time will be 1/25s = 40ms).

    \DK

    allardAuthor
    Visitor II
    August 26, 2021

    Ok, then I will go with freerunning mode at a high ODR. Can I just sample the data registers without checking for the data ready flag (I just need a most recent sample, no sync of any kind needed), or will this cause I2C clock stretching?

    I've got this running in a freeRTOS thread, but sometimes the BUSY bit of the I2C peripheral (STM32F4) gets stuck, i'm suspecting due to clock stretching.