122-32000 Parallax Inc, 122-32000 Datasheet - Page 213

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
This configuration can easily be described in the following simple rules:
If a cog is disabled, its direction register is treated as if were cleared to 0, causing it to exert
no influence on I/O pin directions and states.
Note that because of the “wired-OR” nature of the I/O pins, no electrical contention between
cogs is possible, yet they can all still access I/O pins simultaneously. It is up to the
application developer to ensure that no two cogs cause logical contention on the same I/O pin
during run time.
Using DIRA
Set or clear bits in
The above code sets the entire
15, 13, 12, 7, 6, 5, 4, 1 and 0 to outputs and the rest to inputs.
Using the post-clear (
inputs, or outputs, respectively; it’s not usually desirable to set all I/O pins to outputs,
however. For example:
—and—
The first example above clears the entire
through P31 to inputs. The second example above sets the entire
once) to ones; all I/Os P0 through P31 to outputs.
To affect only one I/O pin (one bit), include the optional Pin(s) field. This treats the
register as an array of 32 bits.
This sets P5 to an output. All other bits of
remain in their previous state.
DIRA := %00000000_00000000_10110000_11110011
DIRA~
DIRA~~
DIRA[5]~~
A. A pin is an input only of no active cog sets it to an output.
B. A pin is an output if any active cog sets it to an output.
DIRA
~
to affect the direction of I/O pins as desired. For example:
) and post-set (
DIRA
4: Spin Language Reference –
'Clear DIRA register (all I/Os are inputs)
'Set DIRA register (all I/Os are outputs)
'Set DIRA bit 5 (P5 to output)
register (all 32 bits at once) to a value that makes I/O pins
~~
DIRA
) unary operators, the cog can set all I/O pins to
DIRA
register (all 32 bits at once) to zero; all I/Os P0
(and thus all other corresponding I/O pins)
Propeller Manual v1.0 · Page 213
DIRA
register (all 32 bits at
DIRA

Related parts for 122-32000