Shop OBEX P1 Docs P2 Docs Learn Events
I/O Master Logic — Parallax Forums

I/O Master Logic

Vega256Vega256 Posts: 197
edited 2011-03-01 10:31 in Propeller 1
Hey Guys,

According to the manual, to avoid I/O bus contention, the Propeller's I/O system is mapped such that,

"A pin is an input only of no active cog sets it to an output.
A pin is an output if any active cog sets it to an output."

So, what will happen if Cog 0 sets a pin or group of pins to an output and then tries to set them as an input?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-01 10:31
    The manual probably could have stated that a little better. A pin will be driven if any active cog sets it to an output. But it's an output only for the cog(s) which have set it as an output. For the other cogs it remains an input only, and the pin's internally-driven state can be read the same as it could be if it were driven externally. If two or more cogs set a pin as an output, the pin state will be the OR of the outputs from those cogs. IOW, if one cog sets a pin high, it is not possible for another cog to override that and reset it low.

    So, to answer your question, if Cog 0 sets a pin to be an output, it can reset it to be an input any time it wants.

    -Phil
Sign In or Register to comment.