Skip to main content
Associate
June 5, 2024
Solved

STHS34PF80: No data

  • June 5, 2024
  • 3 replies
  • 1717 views

Hi,

we have designed a custom board that includes a STHS34PF80 but after triggering a one-shot acquisition, the DRDY bit is never set and reading from the TOBJECT_x and TAMBIENT_x registers without waiting for DRDY only returns 0. We are interfacing the sensor using I2C from an nRF52 SoC.

Implemented procedure:

  • Powering up the sensor (+ wait for 500 ms)
  • Enabling block data update (Reg: 0x20, Data: 0x10)
  • Triggering Acquisition (Reg: 0x21, Data: 0x01)
  • Waiting for DRDY bit to be set (Reg: 0x23), Alternatively: Wait 25 ms and reading registers 0x26-0x29 directly

The sensor ACKs the data transfers so I assume that in terms of the hardware everything is fine, WHO_AM_I (0x0F) correctly returns 0xD3.

Am I missing something?

Thank you very much in advance!

 

 

 

Best answer by NorSen_42

I got a new board with a fresh sensor and there everything works now with my code; haven't tested your driver again but I'm sure it'll work as well. 

I have no idea why I was able to communicate with the sensor but the sampling itself didn't work.

However, now it does so I blame the hardware for it ;) 

3 replies

Federica Bossi
Technical Moderator
June 6, 2024

Hi @NorSen_42 ,

Welcome to ST Community!

Can you try to follow our PID example on github and let me know if you still get no data?

Thanks.

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.
NorSen_42Author
Associate
June 6, 2024

Hi,

thank you for your reply.

I added your driver to my project and executed the following commands. The read and write values of the transfer are based on what the oscilloscope has decoded:

  • sths34pf80_device_id_get -> W: 0x0F, R: 0xD3
  • sths34pf80_one_shot_set -> W: 0x21, R: 0x00, W:0x2101
  • sths34pf80_drdy_status_get (while drdy == 0) -> W: 0x23, R: 0x00

The DRDY bit stays 0.

Can you spot any issues here? Is there more to configure before starting a single-shot acquisition?

 

 
 
Federica Bossi
Technical Moderator
June 12, 2024

Hi @NorSen_42 ,

As reported in the AN5867, section 4.2, to reset the DRDY flag you must read the FUNC_STATUS register (25h).

Using the driver functions, you must add this function: sths34pf80_func_status_get(&dev_ctx, &func_status);

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.
NorSen_42Author
Associate
June 12, 2024

Hi @Federica Bossi,

thanks for your reply but I don't think that this is the problem here. The DRDY flag never gets set. It stays 0 so there is no need to reset it.

Here are the steps proposed in the AN. I am stuck executing 1 and 2 and observing that DRDY stays 0:

1. Read the STATUS (23h) register.
2. If DRDY = 0, then go to 1.
3. Read FUNC_STATUS (25h) to reset the DRDY flag.
4. Read TOBJECT_L (26h).
5. Read TOBJECT_H (27h).
6. Data processing.
7. Go to 1.

NorSen_42AuthorBest answer
Associate
June 22, 2024

I got a new board with a fresh sensor and there everything works now with my code; haven't tested your driver again but I'm sure it'll work as well. 

I have no idea why I was able to communicate with the sensor but the sampling itself didn't work.

However, now it does so I blame the hardware for it ;)