PaulStoffregen / OneWire

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

Updated ARDUINO_ARCH_ESP8266 pin definition to allow use of GPIO16 #88

Closed gnalbandian closed 6 months ago

gnalbandian commented 4 years ago

Fix issue #27 Please check if pin selection under 16 (1-15) still works fine.

PaulStoffregen commented 4 years ago

Have you tested this carefully? This sort of code can play havoc on timing. Did you verify its impact on waveforms, using a logic analyzer or oscilloscope?

Please don't take this lightly. It's easy to have 1-wire devices appear to work fine, but with waveforms having poor timing, only to later realize the waveforms work only with a small number of devices on a short wire.

If you say this is truly read for use by all ESP8266 users, then I will trust your judgement. Please confirm if I really should merge this?

PaulStoffregen commented 4 years ago

Just so you know, I do not test with ESP chips. I'm depending on you & the rest of the ESP community.

mopac commented 1 year ago

Yes I know that the pull request is a couple of years old but OneWire on GPIO16 is a very useful feature. So I have analysed the timing of the Standard Lib against the Modified Lib for ESP8266 GPIO14 and also the modified Lib for GPIO16. Traces captured with logic analyser running at 24MHz sample rate image

The captured traces are attached OneWire timing.zip

As far as I can tell, the timing on GPIO14 is unchanged. The timing on GPIO16 is longer but still within spec

Please integrate this Pull request into the lib. Thanks

Ray