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

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
WAITPEQ
Pause a cog’s execution until I/O pin(s) match designated state(s).
((PUB ┆ PRI))
Explanation
WAITPEQ
WAITPNE
pauses the cog until the value of Port’s I/O pin states, bitwised-ANDed with Mask, matches
that of State.
When executed,
System Clock from causing further code execution within the cog until the moment the
designated pin, or group of pins, equals the indicated state(s). The wait hardware checks the
I/O pins every System Clock cycle and the cog’s power consumption is reduced by
approximately 7/8
Using WAITPEQ
WAITPEQ
The above code pauses the cog until I/O pin 3 is low and I/O pin 2 is high, then sets I/O pin 0
high.
Page 326 · Propeller Manual v1.0
WAITPEQ
waitpeq(%0100, %1100, 0)
outa[0] := 1
, “Wait for Pin(s) to Equal,” is one of four wait commands (
, and
State
indicates the high or low states of up to 32 I/O pins. State is compared against either
(
Mask
bits for every I/O pin that should be monitored; low (0) bits indicate pins that should
be ignored. Mask is bitwised-ANDed with the 32-bit port’s input states and the
resulting value is compared against the entire State value.
Port
Port A exists on current (P8X32A) Propeller chips.
is a great way to synchronize code to external events. For example:
INA
is a 1-bit value indicating the I/O port to monitor; 0 = Port A, 1 = Port B. Only
(State, Mask, Port )
& Mask), or (
is the desired pin(s) to monitor. Mask is a 32-bit value that contains high (1)
is the logic state(s) to compare the pin(s) against. It is a 32-bit value that
WAITVID
– Spin Language Reference
WAITPEQ
ths
during this time.
) used to pause execution of a cog until a condition is met.
INB
activates special “wait” hardware in the cog that prevents the
& Mask), depending on Port.
'Wait for P3 & P2 to be low & high
'Set P0 high
WAITCNT
,
WAITPEQ
WAITPEQ
,

Related parts for 122-32000