PaulStoffregen / OneWire

Library for Dallas/Maxim 1-Wire Chips
http://www.pjrc.com/teensy/td_libs_OneWire.html
579 stars 382 forks source link

ability to use internal pullup resistor #5

Closed maxicus closed 8 years ago

maxicus commented 8 years ago

details here http://wp.josh.com/2014/06/23/no-external-pull-up-needed-for-ds18b20-temp-sensor/

PaulStoffregen commented 8 years ago

This code seems to assume AVR registers. No other microcontrollers enable their pullup resistors by writing to their output registers. Only AVR does this!

Testato commented 8 years ago

is there other problem too: the internal pullup is about 10 times higher that the 4.7kOhm required, so on some device it will work and on others can be a problem. The internal pullup value is about 50kOhm

maxicus commented 8 years ago

Sure, it's not a solution for a whole world.That's up to you if AVR is enough or not. It should not affect anything until constant defined. I've put everything into ifdef's except one line in disconnect - think that was missing even for normal operation.

@Testato that's what my original comment https://github.com/PaulStoffregen/OneWire/pull/5#issue-115393698 about.