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

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
WAITPNE
Pause a cog’s execution until I/O pin(s) do not match designated state(s).
((PUB ┆ PRI))
Explanation
WAITPNE
WAITPNE
the complimentary form of
bitwised-ANDed with Mask, does not match 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, does not equal the designated 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 WAITPNE
WAITPNE
The above code pauses the cog until P3 is low and P2 is high, then pauses the cog again until
one or both of those pins changes states, then it sets P0 high.
Page 328 · Propeller Manual v1.0
WAITPNE
waitpeq(%0100, %1100, 0) 'Wait for P3 & P2 to be low & and high
waitpne(%0100, %1100, 0) 'Wait for P3 & P2 to not match prev. state
outa[0] := 1
, “Wait for Pin(s) to Not 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)
WAITVID
is the logic state(s) to compare the pins against. It is a 32-bit value that
– Spin Language Reference
WAITPNE
ths
) used to pause execution of a cog until a condition is met.
during this time.
INB
activates special “wait” hardware in the cog that prevents the
WAITPEQ
& Mask), depending on Port.
; it pauses the cog until the value of Port’s I/O pin states,
'Set P0 high
WAITCNT
WAITPNE
,
WAITPEQ
is
,

Related parts for 122-32000