STHS34PF80: No data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-05 9:49 AM - edited ‎2024-06-05 9: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:
- 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!
Solved! Go to Solution.
- Labels:
-
Environmental Sensors
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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 ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-06 2: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-06 5: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:
- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-12 4: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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-12 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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 ;)
