Prop1 outputs....
frank freedman
Posts: 1,983
in Propeller 1
Question on the Prop 1 IO. As I understand it on the propeller, if I have three cogs sharing a single I/O pin with the dira set to output on that pin, and the cogs on that pin outputing a high, the state of that pin will be high until all of the cogs on that pin are output low state. So if a fourth cog is monitoring that same pin, it should only see a low on that pin when all cogs set to output on that pin are low. I want to be able to tell when each of three cogs are in a ready state (here designated low) on a single pin input to the monitoring cog.
Can the pin be damaged if I have cogs output low and some output high on that same pin at the same time?
Thanks
Can the pin be damaged if I have cogs output low and some output high on that same pin at the same time?
Thanks
Comments
No, that is taken care of in the Logic.
Manual says:
2. Pin Outputs are the result of OR'ing the output states of the cogs together. A cog's
output state consists of the bits of its I/O modules (the Counters, the Video Generator, and the I/O Output Register) OR'd together then AND'd with the bits of its Direction Register.
In essence, each I/O pin’s direction and output state is the “wired-OR” of the entire cog collective.
This allows the cogs to access and influence the I/O pins simultaneously without the need for any resource arbiter and without any possibility of electrical contention between the cogs.
The result of this I/O pin wiring configuration can easily be described in the following simple
rules:
A. A pin is an input only if no active cog sets it to an output.
B. A pin outputs low only if all active cogs that set it to output also set it to low.
C. A pin outputs high if any active cog sets it to an output and also sets it high.
-Phil
Edit: Not only can the slave determine which master is not ready, but also why.