diff options
| author | Elias Wimmer <elias.wimmer@tuwien.ac.at> | 2023-12-10 23:25:14 +0100 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-12-15 17:08:09 +1100 |
| commit | 2e101a8e44b7f1bff75cc06a0597c572a8d8d152 (patch) | |
| tree | 3c04dd5482bd3efd3bc2910d78245d096d2fd137 | |
| parent | 06df3b29256e4e90abc61505a28852268cf64af7 (diff) | |
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
| -rw-r--r-- | extmod/modonewire.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/extmod/modonewire.c b/extmod/modonewire.c index dbd519776..844418181 100644 --- a/extmod/modonewire.c +++ b/extmod/modonewire.c @@ -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) { |
