-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I tried the HX711 with CircuitPython and I got some strange results (on an ESP32 chip). So I analyzed the signal and this is what I found.

Sometimes, the clock signal (in orange) stays too long (almost 80µs) up at the start of the sequence. This is longer than the maximum allowed of 50µs (T3)

In this case, the data stays at 1, and the result is 0xFFFFFF and this is easy to detect.
However, sometimes, the clock stays high in the middle of the sequence:

The data line stays up after the long pulse, and the measure is wrong (and not easy to detect).
I understand that Bit Banging a signal with a time constraint might be challenging with CircuitPython. This could perhaps be solved by disabling the interrupts (https://docs.circuitpython.org/en/stable/shared-bindings/microcontroller/#microcontroller.disable_interrupts) and doing active polling instead of using time.sleep().
Let me know if you want me to investigate further and come up (if possible) with a PR.