Quadrature Decoder (Q-Decoder)
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
453
21
Quadrature Decoder (Q-Decoder)
21.1
Overall Description
21.1.1
Introduction
Quadrature encoders(Q-Decoder) are used to determine the position and speed of a rotary device, such as servo-motors, volume control
wheels, PC mice, etc. The decoded quadrature signals are used as a sensory input to a system to determine the absolute or relative position of
the rotary device, which can be used in a control loop,for example, the servo-motor.
21.1.2
Features
16-bits position counter
Index signal of rotation
Position compares interrupt
Rotation compares interrupt
Auto initialization
Input debounce
Auto-index mechanism
Rotation Velocity Measurement
Velocity compare function with “less or more than” interrupt
Maximum input signal frequency is 200KHz, or 100KHz when index signal related functions are used
21.1.3
Application Scenario
Fig 21-1 shows typical quadrature signals from a rotary encoder. The signals named PHA and PHB are two quadrature signals. The figure shows
how phase relationship determines the direction of rotation. When PHA leads PHB, the rotation is defined as forward (+). When PHB leads
PHA, the rotation is defined as reverse (-). The concatenation of the two phase signals is called the quadrature state or the phase state. The
signal shown in the figure as IDX (index pulse) is used for absolute positioning. It is usually tagged as the “0” of absolute position. The width of
an IDX pulse must be smaller than a 4-state cycle. If the width of the IDX pulse is bigger than 1 state, the software can use the register setting
to locate the IDX pulse to a specified state. So the Q-Decoder hardware can process the IDX pulse signal only located in the specified state. The
IDX signal is located at state “00” in the example shown in Fig 21-2.
Ameba-D
Device
Q-decoder
PHA
PHB
IDX
Fig 21-1 Q-Decoder application scenario
Realtek confidential files
The document authorized to
SZ99iot
2019-05-15 10:08:03