Quad quadrature encoder object

Warning message

The Propeller Object Exchange system is decommissioned and replaced with a GitHub repository to house the same existing and future Propeller objects. As of 12/5/2019, this site is read-only. You can continue to browse and download objects from here for a limited time; however, please begin using the Parallax Propeller repository for future reference.
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Request group membership
By: created: 2014-03-20 | updated: 2014-03-20

PASM object to handle one to four AB quadrature encoders in one cog.  Uses WAITPNE instruction to minimize power consumption when idle.

All transitions are accounted for and the input pins are read simultaneously avoiding possibility of faulty accounting unless the rate is too high a frequency.  Expected throughput is one encoder at upto 1M counts/second (250k pulses/sec) and four encoders at about a quarter that rate if simultaneously active.

Errors (when both A and B change within one loop of the driver) are detected and an error count is updated.  The object provides a simple 32 bit encoder count and an error count per encoder.  Unused channels are marked by giving $FF as pin numbers for that channel.  There is no restriction on pin numbering at all.

A simple example is provided.

Original File Upload
Package icon encoder-test-bst-archive-140320-224551.zip14.83 KB