OBQC: Introduction
The OnBoard Quadrature Counter (normally abbreviated to "OBQC") is an intrinsic Firmware function that is implemented on a number of SPLat controller boards. This guide covers the aspects of the OBQC that are common to all implementations.
The OBQC is a feature of the controller's operating firmware. Early releases of the MS12 and SL99 did not contain the OBQC in their firmware, but can be upgraded via the reFlash facility to incorporate the OBQC function. The MMi201 will have it from the beginning. The OBQC instructions are first found in dialect 16.
You should also read the OBQC specific material in the documentation for the specific controller (board) you are using.
The OBQC provides direction sensitive up/down counting for a quadrature encoder connected to two designated input pins. It provides a 24-bit counter and in most controllers for which it is implemented can count at up to 3,000 input transitions per second for 8-bit controllers such as the CC18, or 300kHz for 32-bit controllers such as the DC216 and DT16.
A quadrature encoder is an incremental encoder with two outputs, usually called A and B, which produce square wave signals 90 degrees out of phase. With such an encoder it is possible to determine both the amount of movement or rotation and the direction.
Hint: Use a quadrature encoder only if your application really does need to track direction. If all you need is the amount of movement, because the direction is fixed or known, there's no need to use quadrature encoding. If however mechanical imperfections can produce unpredictable movement a quadrature encoder may be appropriate.
See also the OnBoard Counter A and OnBoard Counter B for different counting capabilities.