---
title: WAITPEQ and WAITPNE with PASM
description: "[PASM](https://obex.parallax.com/code-language/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…"
url: "https://obex.parallax.com/docs/chips-tips/propeller-1/waitpeq-and-waitpne-with-pasm/"
updated: "2025-04-15"
category: Propeller 1
---

# WAITPEQ and WAITPNE with PASM

[PASM](https://obex.parallax.com/code-language/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](https://www.parallax.com/package/propeller-manual)

[Parallax Propeller 1 Documentation](https://www.parallax.com/download/propeller-1-documentation)

---
