Propeller Manual

Table Of Contents
2: Spin Language Reference – OUTA, OUTB
OUTA, OUTB
Register: Output registers for 32-bit Ports A and B.
((PUB PRI))
OUTA [Pin(s)]
((PUB PRI))
OUTB [Pin(s)] (Reserved for future use)
Returns: Current value of output Pin(s) for Port A or B, if used as a source variable.
Pin(s) is an optional expression, or a range-expression, that specifies the I/O pin, or
pins, to access in Port A (0-31) or Port B (32-63). If given as a single expression,
only the pin specified is accessed. If given as a range-expression (two expressions in
a range format; x..y) the contiguous pins from the start to end expressions are
accessed.
Explanation
OUTA and OUTB are two of six registers (DIRA, DIRB, INA, INB, OUTA and OUTB) that directly affect
the I/O pins. The
OUTA register holds the output states for each of the 32 I/O pins in Port A;
bits 0 through 31 correspond to P0 through P31. The
OUTB register holds the output states for
each of the 32 I/O pins in Port B; bits 0 through 31 correspond to P32 through P63.
NOTE:
OUTB is reserved for future use; the Propeller P8X32A does not include Port B I/O
pins so only
OUTA is discussed below.
OUTA is used to both set and get the current output states of one or more I/O pins in Port A. A
low (0) bit sets the corresponding I/O pin to ground. A high (1) bit sets the corresponding I/O
pin VDD (3.3 volts). All the
OUTA register’s bits default to zero (0) upon cog startup.
Each cog has access to all I/O pins at any given time. Essentially, all I/O pins are directly
connected to each cog so that there is no hub-related mutually exclusive access involved.
Each cog maintains its own OUTA register that gives it the ability to set any I/O pin’s output
state (low or high). Each cog’s output states is OR’d with that of the other cogs’ output states
and the resulting 32-bit value becomes the output states of Port A pins P0 through P31. The
result is that each I/O pin’s output state is the “wired-OR” of the entire cog collective. See
I/O Pins on page 26 for more information.
Propeller Manual v1.1 · Page 175