OBCA: Introduction
The OnBoard Counter type A (normally abbreviated to "OBCA") is an onboard SPx peripheral that is implemented on a number of SPLat controller boards. This guide covers the aspects of the OBCA that are common to all implementations.
The OBCA is a hardware feature of the controller's microprocessor chip made available to you as part of the SPLat programming language. Early releases of the MMi99 and SL99 did not contain the OBCA in their Firmware, but can be upgraded via the reFlash facility to incorporate the OBCA function.
You should also read the OBCA specific material in the documentation for the specific controller (board) you are using.
The OBCA provides frequency counting (counting pulses over a pre-determined time interval) and totalized counting.
See also the OnBoard Quadrature Counter for a different counting feature.
Frequency counting
The frequency counting function provided by the OBCA counts input pulses over a period of 0.1S, 1S or 10S (called the timebase) and then make that count available as a floating point number. The count range is 0 to 65,535 (a 16-bit counter).
- If a 1S timebase is used, the count obtained will be the same as the input frequency in Hz.
- If a 0.1S timebase is used, the count will be one tenth of the frequency, meaning you could theoretically count frequencies up to about 650kHz (in practice filtering on the hardware input will make that unattainable).
With a 10S timebase you can count lower frequencies. For example, you could measure the power line frequency to a resolution of 0.1Hz.
Totalized counting
The totalizing counter function provided by the OBCA simply counts input pulses. Your program can read out the count without resetting it, or it can read and reset the counter in a single operation. The count range is 0 to 16,777,215 (a 24-bit counter).