2024-06-05 09:49 AM - edited 2024-06-05 09:50 AM
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:
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!
Solved! Go to Solution.
2024-06-22 11:21 AM
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 ;)
2024-06-06 02:26 AM
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.
2024-06-06 05:31 AM
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:
The DRDY bit stays 0.
2024-06-12 04:42 AM
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);
2024-06-12 05:26 AM
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.
2024-06-22 11:21 AM
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 ;)