Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • Shop
  • Blog
Propeller OBEX
  • OBEX
  • Forum
Login
Propeller OBEX
View Categories
  • Home
  • Docs
  • Propeller 2
  • Using the counter for timeouts

Using the counter for timeouts

Reading Time: < 1 min read

PASM2

Introduction #

Each cog has independent counters that can run in the background and support your code without overhead.

The counters can perform many operations, and here we mention using them for operation timers.

Code Snippet #

These code snippets show an efficient way to setup your own timeout and check them using the pollct instructions

  1. Setup your own timeout
getct      timeout                         ' set timeout value
addct1     timeout,          ##delay1s       
  1. Test if the timeout has been exceeded
pollct1    wc
if_c       jmp              #timed_out      

Resources #

Parallax Propeller 2 - Spin2 Language Documentation


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

Still stuck? How can we help?

Updated on January 10, 2025
Table of Contents
  • Introduction
  • Code Snippet
  • Resources

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