DS18B20: one works, one doesn’t on STM32L071 (both OK on Arduino)
TL;DR: Two “DS18B20” sensors both work on Arduino, but on my STM32L071xx board only one works; the other never responds. I’m generating 1 µs delays from a 32 MHz clock. Suspecting clone/timing or power-mode differences. Looking for gotchas others have hit on STM32/1-Wire.
Context / setup
MCU: STM32L071xx, 3.3 V logic
Bus: single DS18B20 per test (no multi-drop)
Pull-up: 4.7 kΩ to 3.3 V (external)
Wiring length: 50 cm
Power mode: 3-wire
Timing: delays built from 32 MHz system clock, 1 µs granularity (busy-wait / timer)
What I see
Arduino (5 V): both sensors enumerate, convert, and read fine.
STM32L071 (3.3 V): Sensor A works flawlessly; Sensor B shows no presence pulse / no ROM code (or occasionally garbage/CRC fail, depending on timing tweaks).
What I’ve tried
Verified wiring continuity and pinout (DATA/VDD/GND).
Switched the STM32 GPIO to open-drain, high-speed; internal pulls disabled.
Tried stronger pull-ups (3.3 kΩ / 2.2 kΩ).
Stretched/relaxed timings around spec:
Reset low: ~520 µs, sample presence at ~70–80 µs after release
Write ‘1’: low 6–10 µs, slot ≥60 µs
Write ‘0’: low ~60 µs
Read: low 2–5 µs, sample at ~12–18 µs, slot ≥60 µs
Confirmed idle bus sits at 3.3 V.
I'm really stuck here, and tempted to buy an extra official DS18B20 probe to test my hypothesis.
Any Advice apreciated :)
I can share my code if wanted but i followed this tutorial. (only diffrence is clock speed, but that shouldn't matter)
