Hi, I've been using a ds18b20 sensor with a Pico 1 successfully in a c++ project. I wanted to try the new Pico 2 but am having problems with the exact same sensor and wiring. I've tried several different onewire libraries that all work on the Pico 1 but not on the Pico 2.
On the pico 2 it can find a device but with address of all zeros. Then nothing else works. I've tested the gpio pin to at least be able to flash a LED so I doubt that is broken.
Anyone have any ideas of why I'm having this issue? I've been trying to figure out differences between the two boards but can't much. Can it be a timing issue due to different clocks?
Here are some of the libraries:
https://github.com/jondurrant/RP2040PIO-DS18B20
https://github.com/adamboardman/pico-onewire
https://github.com/tjko/pico-1wire-lib
The wiring is the same, e.g. something like this
Image may be NSFW.
Clik here to view.
On the pico 2 it can find a device but with address of all zeros. Then nothing else works. I've tested the gpio pin to at least be able to flash a LED so I doubt that is broken.
Anyone have any ideas of why I'm having this issue? I've been trying to figure out differences between the two boards but can't much. Can it be a timing issue due to different clocks?
Here are some of the libraries:
https://github.com/jondurrant/RP2040PIO-DS18B20
https://github.com/adamboardman/pico-onewire
https://github.com/tjko/pico-1wire-lib
The wiring is the same, e.g. something like this
Image may be NSFW.
Clik here to view.

Statistics: Posted by Link46 — Sat Apr 12, 2025 10:55 am