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

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
The first line in the code above sets I/O pin 10 to output. The second line clears P10’s output
latch bit, making P10 output low (ground). The third line sets P10’s output latch bit, making
P10 output high (VDD).
In Spin, the
which allows you to affect a group of I/O pins at once, without affecting others outside the
specified range. To affect multiple, contiguous I/O pins at once, use a range expression (like
x..y) in the Pin(s) field.
The first line, “
their previous state. The second line, “
and P9 to output low.
IMPORTANT: The order of the values in a range-expression affects how it is used. For
example, the following swaps the order of the range from the previous example.
Here,
set equal to 1, 1, 0, 0, and 1, respectively, making P8, P9 and P12 output high and P10 and
P11 output low.
This is a powerful feature of range-expressions, but if care is not taken it can also cause
strange, unintentional results.
Normally
output latch states. This is ONLY the cog’s output latch states, not necessarily the actual
output states of the Propeller chip’s I/O pins, as they can be further affected by other cogs or
even this cog’s other I/O hardware (Video Generator, Count A, etc.). The following assumes
Temp
The above sets
equal to
Page 282 · Propeller Manual v1.0
DIRA[12..8]~~
OUTA[12..8] := %11001
DIRA[8..12]~~
OUTA[8..12] := %11001
Temp := OUTA[15..13]
is a variable created elsewhere:
DIRA
OUTA15:13
OUTA
bits 8 through 12 are set to high (like before) but
OUTA
is only written to but it can also be read from to retrieve the current I/O pin
DIRA…
Temp
register supports a special form of expression, called a range-expression,
and the other bits of
– Spin Language Reference
equal to
,” sets P12, P11, P10, P9 and P8 to outputs; all other pins remain in
OUTA
bits 15, 14, and 13; i.e.: the lower 3 bits of
OUTA…
'Set DIRA12:8 (P12-P8 to output)
'Set P12:8 to 1, 1, 0, 0, and 1
'Set DIRA8:12 (P8-P12 to output)
'Set OUTA8:12 to 1, 1, 0, 0, and 1
'Get output latch state of P15 to P13
Temp
are cleared to zero.
,” sets P12, P11, and P8 to output high, and P10
OUTA
bits 8, 9, 10, 11 and 12 are
Temp
are now

Related parts for 122-32000