ESP32-compatible C libraries for Maxim Integrated 1-Wire bus and DS18B20 digital thermometer

David Antliff seems to have done a great job already for preparing the 1-wire driver for ESP32. This is very important in the context of Protect code when accessing shared resources.

Please note:

This component includes two methods of bus access - delay-driven GPIO and RMT-driven slots. The original implementation used CPU delays to construct the 1-Wire read/write timeslots however this proved to be too unreliable. A second method, using the ESP32’s RMT peripheral, results in very accurate read/write timeslots and more reliable operation.

Therefore I highly recommend that you use the RMT driver [contributed by chmorgan (Chris Morgan) · GitHub]. The GPIO driver should be considered deprecated.

There’s also a driver for the popular DS18B20 1-wire digital thermometer already:

… and an example implementation tying everything together:

Auf einem anderen ESP32-Board teste ich gerade die Loboris-ESP32-micropython-Variante (GitHub - loboris/MicroPython_ESP32_psRAM_LoBo: MicroPython for ESP32 with psRAM support) , bei dieser ist der Support für DHT und 1wire bereits per RMT peripheral realisiert, da ist Pycom leider deutlich hinterher.

Achja, und sie haben auch mDNS und echte threads …!

1 Like

Profis am Werk ;]. Danke! Ich freue mich über Berichterstattungen, wie es dort so aussieht.

Paradiesische Zustände!

Exzellent. Ich glaube das hatten wir damals schon von dort aufgeschnappt und würden es ebenfalls gerne haben.

Die wiederum gibt es bei Pycom genauso, denke ich. Außer ich habe etwas übersehen. Bei Multithreading und Scheduling unter MicroPython können wir ggf. ins Detail gehen.

Pure-MicroPython-Ansteuerung des RMT für Pycom-Geräte seit gestern auch frisch bei RMT controller RAM. Vielleicht könnte das interimsmäßig die Situation noch verbessern, solange wir noch keinen vollständigen C-Level Treiber genießen dürfen.

1 Like