After much fiddling I am finally able to talk to a CH101 with a RP2040 and get samples at near the specified ODR. With that said, the way I did it is a bit messy and to get samples I have to continually soft-reset the device per the API. The CH101 is not sending out regular interrupts per the datasheet in free-run mode and hangs after a single sample which is why I must reset it.
NickFs:
After much fiddling I am finally able to talk to a CH101 with a RP2040 and get samples at near the specified ODR. With that said, the way I did it is a bit messy and to get samples I have to continually soft-reset the device per the API. The CH101 is not sending out regular interrupts per the datasheet in free-run mode and hangs after a single sample which is why I must reset it.
Any thoughts on why this is happening?
hello sir, I am working on this sensor with nrf52, but I am stuck, so can you please send me this code, I am real grateful to you if you send and also some detail about this code like which IDE used and any important detail and maybe, I am able to find interrupt behavior of this sensor. I hope you reply soon, thank you
Hello, I sent you an email. A bunch of the API files are modified so you can do a code compare and see the changes.
For anyone else that is interested, it does better than a standard ToF sensor for glass or water but worse otherwise. Primary benefit over the other is probably the lower power consumption. Never did figure out the issue but I have since moved on with a Tof Sensor.
For everyone interested: The INT pin on the SparkFun-Breakout cannot work as it has a severe design flaw. As outlined in chapter 8.7 (Use of level shifters) of the Datasheet, the INT line needs a special handling. In the reference circuit the INT pin is pulled low, on the SparkFun breakout board a regular autosense levelshifter is used, which pulls the pin high. To ensure proper reset of the INT line the datasheet tells explicitly NOT to use autosense level shifters on this pin. Therefore this pin can never work in triggered mode or send an interrupt as long as the Breakout is used as is!
For mitigation and possible reuse of the breakout board you can manually desolder the level shifter circuit for this pin (Only if all pullups and the transistor is removed it can work!) and add a level shifter with manual direction control as recommended in the datasheet.