Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • More
    • Shop
    • Blog
Propeller OBEX
  • More
    • OBEX
    • Forum
Login
Propeller OBEX
View Categories
  • Home
  • Docs
  • 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:

spin
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:

spin
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:

spin
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:

spin
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
Table of Contents
  • Introduction
  • Examples
  • Resources

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

{{language}}