Skip to content

Bit timing inaccurate with multi threading #71

@ssharks

Description

@ssharks

The bit timing is arranged with delayMicroseconds(500);. On a single threaded application this works reasonable stable although rounding errors tend to accumulate.
As soon as multiple threads are used on an ESP32 or ESP8266, this is no longer guaranteed to take 500 us. Depending on the OS scheduling this causes some communication to work, sometimes not to work.

Would it be better to use a timer for the bit timing? This guarantees the bit timing independent of scheduling and does not accumulate timing errors.

A workaround on the ESP32: Ensure all Opentherm communication is on 1 core, ensure the parrallel tasks are running on the other core.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions