summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Van Oosterwijck <patrick@silicognition.com>2021-03-17 23:15:20 -0600
committerDamien George <damien@micropython.org>2023-12-15 17:04:33 +1100
commit06df3b29256e4e90abc61505a28852268cf64af7 (patch)
treea9f8eab53e6c2d12a818f95ac5b981f95e021e2f
parentde3e83aa4d9b671e6c5581ce19f98aa06f96e255 (diff)
extmod/modonewire: Adopt Maxim recommended read timings.
The timing of the onewire module was way too fast when reading. This commit adopts read timings as recommended in Maxim application note 126: 6 us (pulse) / 9 us (sample) / 55 us (bit slot). See also: https://www.analog.com/en/technical-articles/1wire-communication-through-software.html Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--extmod/modonewire.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/extmod/modonewire.c b/extmod/modonewire.c
index f440f75a8..dbd519776 100644
--- a/extmod/modonewire.c
+++ b/extmod/modonewire.c
@@ -38,9 +38,9 @@
#define TIMING_RESET1 (480)
#define TIMING_RESET2 (70)
#define TIMING_RESET3 (410)
-#define TIMING_READ1 (5)
-#define TIMING_READ2 (5)
-#define TIMING_READ3 (40)
+#define TIMING_READ1 (6)
+#define TIMING_READ2 (9)
+#define TIMING_READ3 (55)
#define TIMING_WRITE1 (10)
#define TIMING_WRITE2 (50)
#define TIMING_WRITE3 (10)