Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • Shop
  • Blog
Propeller OBEX
  • OBEX
  • Forum
Login
Propeller OBEX

Propeller 1

  • How to pause in PASM
  • How to choose between VAR and DAT
  • WAITPEQ and WAITPNE with PASM
  • IO pin manipulation using PASM
  • Control IO pins from any cog
  • 3D Models for Parallax Products
  • Implementing Abstract Data Structures with Spin Objects
  • Making in USA - The Parallax 8 core microcontroller
  • Simultaneous pin group control
  • Programming the FLiP module over WiFi
  • Keep any value in range
  • Handy Diagnostic Heartbeat
  • Customer Code Deployment in one click

Propeller 2

  • Floating point operators in SPIN2
  • 64/96/128-Bit Unsigned Integer Math
  • 3D Models for Parallax Products
  • DEBUG Plot Layer and Crop
  • Floating point
  • Getting Started Video Tutorials
  • Using the counter for timeouts
  • asmclk and the automatic clock setter
  • Sharing variables between SPIN2 and PASM2
  • Keep any value in range
  • Determine pin state - High, Low or Floating?
View Categories
  • Home
  • Docs
  • Chips Tips
  • Propeller 1
  • WAITPEQ and WAITPNE with PASM

WAITPEQ and WAITPNE with PASM

Reading Time: < 1 min read

PASM

Introduction #

WAITPEQ and WAITPNE are two complimentary commands that pause execution in a cog until I/O pin(s) meet designated state(s).

WAITPEQ (WAIT until Pins EQual) pauses the cog until pin/s match,

WAITPNE (WAIT until Pins Not Equal) pauses the cog until pin/s no longer match.

Examples #

Using WAITPxx with a single pin:

WAITPEQ mypin,mypin   'wait for it to be high
WAITPNE mypin,mypin   'wait for it to be low
mypin long |<12       'P12 (pin 12)

How to wait for either of 2 pins to be low:

WAITPNE mytwopins,mytwopins   'wait for either one (or both) to be low 
mytwopins long |<12 | |<13    'the two pins ORed

How to wait for 2 pins where one is low and one is high:

WAITPEQ mypinstate,mytwopins  'wait for a match 
mytwopins  long |<12 | |<13   'the two pins ORed
mypinstate long |<12          'pin 12 needs be high and pin 13 needs to be low

How to wait for 2 pins where either one is high:

WAITPNE myzero,mytwopins    'wait for either one to be high 
mytwopins long |<12 | |<13  'the two pins ORed
myzero    long 0            'zero long for WAITPNE state comparison

Resources #

Parallax Propeller 1 Manual

Parallax Propeller 1 Documentation


Was this useful ?
Share This Article :
  • Facebook
  • X
  • LinkedIn
Still stuck? How can we help?

Still stuck? How can we help?

Updated on April 15, 2025
How to choose between VAR and DATIO pin manipulation using PASM
Table of Contents
  • Introduction
  • Examples
  • Resources

Copyright © 2025 - Parallax Inc.
599 Menlo Drive | Rocklin, CA 95765 | USA