Commit 2e101a8e authored by Elias Wimmer's avatar Elias Wimmer Committed by Damien George

extmod/modonewire: Improve write timings for better reliability.

When using long cables for sensors on onewire e.g. ds18b20, the current
default timings are too optimistic, leading to bus failures and CRC errors.

Stable results are achieved with the timings given by
https://www.analog.com/en/technical-articles/1wire-communication-through-software.html
parent 06df3b29
......@@ -41,8 +41,8 @@
#define TIMING_READ1 (6)
#define TIMING_READ2 (9)
#define TIMING_READ3 (55)
#define TIMING_WRITE1 (10)
#define TIMING_WRITE2 (50)
#define TIMING_WRITE1 (6)
#define TIMING_WRITE2 (54)
#define TIMING_WRITE3 (10)
STATIC int onewire_bus_reset(mp_hal_pin_obj_t pin) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment