Page 1 of 1

OneWire / DS18B20 Pin problem - BUG

Posted: 18 Mar 2023 14:20
by niles23
Hello guys,

i've problems with OneWire. On the Hhomepage is written, that any pin is usable (https://z-uno.z-wave.me/Reference/ZUNO_OneWire/). I tried many ports (14,15, 4, ...) but it only worked with pin 9-12 (with Zuno 2 rev. 6). With Zuno 1 it was possible to use Port 14.

Summary Zuno2 r6:
OneWire is working on Pin 9-12 and doesn't work on Pin 4, 7, 8, 14, 15

My problem is, that I'va made a printed circuit board and I can't use the working pins.

I used your example sketch to test it.

What can I do? Is this a known bug? Will it be fixed?

Thank you!

Re: OneWire / DS18B20 Pin problem - BUG

Posted: 20 Mar 2023 20:35
by amatilda
Hello. Thank you for writing - there is a small error in the code.

To fix it, you need in the file hardware\arduino\zunoG2\libraries\ZUNO_OneWire\ZUNO_OneWire.cpp on line 439 replace:

Code: Select all

GPIO->P[real_port].MODEL = (GPIO->P[real_port].MODEL & ~(0xFu << (real_pin))) | (mode << (real_pin << 2 ));
on

Code: Select all

GPIO->P[real_port].MODEL = (GPIO->P[real_port].MODEL & ~(0xFu << (real_pin << 2))) | (mode << (real_pin << 2 ));

Re: OneWire / DS18B20 Pin problem - BUG

Posted: 21 Mar 2023 10:47
by niles23
Thank you very much for the fast reply and fix.

It's working very well!