Skip to content

Wrong measures with ESP32 #7

@supcik

Description

@supcik

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.

Image

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)

Image

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:

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions