-->
Page 1 of 1

How use D0 read DS18B20 onewire?

PostPosted: Thu Jul 21, 2022 7:53 am
by Mylovetron
I have a homework to use D0(GPIO16) of nodeMcu as input on DS18b20 (onewire), but it does not work.
I tried using d1,d2,d3 instead and that worked fine. I have a resistor pullup to 3.3v.
Any ideas on how to make that work with D0? Do I need to make some specific setup?

Re: How use D0 read DS18B20 onewire?

PostPosted: Fri Jul 22, 2022 3:26 am
by btidey
GPIO16 is different to all the other GPIO in that it is not accessed directly via io registers but is part of the RTC section of the chip.

Accessing it is much slower and will be upsetting the timing of a one wire connection.

It is best to avoid GPIO16 for any time critical operation.