OneWire / DS18B20 Pin problem - BUG

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
niles23
Posts: 8
Joined: 22 Jul 2018 15:56

OneWire / DS18B20 Pin problem - BUG

Post 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!
amatilda
Posts: 60
Joined: 26 Sep 2021 22:09

Re: OneWire / DS18B20 Pin problem - BUG

Post 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 ));
niles23
Posts: 8
Joined: 22 Jul 2018 15:56

Re: OneWire / DS18B20 Pin problem - BUG

Post by niles23 »

Thank you very much for the fast reply and fix.

It's working very well!
Post Reply