![](http://datasheet.mmic.net.cn/330000/MB90F654A_datasheet_16438029/MB90F654A_48.png)
48
MB90650A Series
7. 8/16-bit Up/Down Counter/Timer
8/16-bit up/down counter/timer is an up/down counter/timer and consists of six event input pins, two 8-bit up/
down counters, two 8-bit reload/compare registers, and their control circuits.
(1) Main Functions
The 8-bit count register can count in the range 0 to 256 (or 0 to 65535 in 1
×
16-bit operation mode).
The count clock selection can select between four different count modes.
Count modes
Two different internal count clocks are available in timer mode.
Count clock (at 16 MHz operation)
In up/down count mode, you can select which edge to detect on the external pin input signal.
Detected edge
Phase difference count mode is suitable for motor encoder counting. By inputting the A, B, and Z phase outputs
from the encoder, a high-precision rotational angle, speed, or similar count can be implemented simply.
Two different functions can be selected for the ZIN pin.
ZIN pin
Counter clear function
Gate function
Compare and reload functions are available and can be used either independently or together. A variable-
width up/down count can be performed by activating both functions.
Compare/reload function
Whether or not to generate an interrupt when a compare, reload (underflow), or overflow occurs can be set
independently.
The previous count direction can be determined from the count direction flag.
An interrupt can be generated when the count direction changes.
Timer mode
Up/down counter mode
Phase difference count mode (
×
2)
Phase difference count mode (
×
8)
125 ns (8 MHz: Divide by 2)
0.5
μ
s (1 MHz: Divide by 8)
Detect falling edges
Detect rising edges
Detect both rising and falling edges
Edge detection disabled
Compare function (Output an interrupt when a compare
occurs.)
Compare function (Output an interrupt and clear the
counter when a compare occurs.)
Reload function (Output an interrupt and reload when
an underflow occurs.)
Compare/reload function
(Output an interrupt and clear the counter when a
compare occurs. Output an interrupt and reload when
an underflow occurs.)
Compare/reload disabled