Esp8266 port #6478
Replies: 1 comment
-
Posted at 2015-10-25 by @allObjects Most MPUs have kind of an 'outo-pin-mode': for no - and obviously some particular pin mode - settings, writing (a particular value) to a pin makes it an output, and reading from it makes it an input... It can be confusing at some times, but smartly applied, it reduces the amount of code and circuitry... It all depends how the output/input pin hareware registers are set and configured and are wired. The setup allows to have have them independent. With open-drain is like bipolar open-collector: only hight / logical 1 matters from a driving / output point of view, and low / logical 0 behaves like tri-state. Said so, the input is driven be the outside and can be either high / logical 1 or low / logical 0. If the pin line is connected to a bus like line and is 'terminated' - pulled in either direction - with a 'weak resistor', it works quite neat for the one-wire setup. Posted at 2015-10-26 by tve To resolve the jshPinGetValue issue: it makes sense to read the pin when it's in open-drain mode without changing its mode and it works correctly on the esp8266, the issue I encountered was a different one. Posted at 2015-10-26 by @gfwilliams
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-10-25 by tve
I'm looking at the OneWire code and it sets the one-wire pin to open-drain, outputs some pulses and then does a jshPinGetValue without setting the pin to input. That's surprising... It seems like jshPinGetValue is expected to detect that the pin is not input mode and then switch it? Is it supposed to switch the pin back to the output mode it was in or leave it in input mode?
Is jshPinSetValue supposed to do the same and switch to output if the pin isn't?
Beta Was this translation helpful? Give feedback.
All reactions