Specifications
Quadrature Encoder Pulse (QEP) Circuit
6-79
Event Manager (EV)
Figure 6–34. Quadrature Encoder Pulse (QEP) Circuit Block Diagram for EVB
2
CAPCONB[13,14]
2
2
2
QEP
decoder
logic
GPT4 clock
GPT4 dir
T4CON[4,5]
TDIRB
CLK
DIR
CAP4/QEP3
CAP5/QEP4
GP timer 4
Prescaler
T4CON[8,9,10]
CLKOUT
CLKIN
2
Capture
unit 4,5
M
U
X
M
U
X
M
U
X
2
6.9.3 Decoding
Quadrature encoded pulses are two sequences of pulses with a variable fre-
quency and a fixed phase shift of a quarter of a period (90 degrees). When gen-
erated by an optical encoder on a motor shaft, the direction of rotation of the
motor can be determined by detecting which of the two sequences is the lead-
ing sequence. The angular position and speed can be determined by the pulse
count and pulse frequency.
QEP Circuit
The direction detection logic of the QEP circuit in the EV module determines
which one of the sequences is the leading sequence. It then generates a direc-
tion signal as the direction input to GP timer 2 (or 4). The timer counts up if
CAP1/QEP1 (CAP4/QEP3 for EVB) input is the leading sequence, and counts
down if CAP2/QEP2 (CAP5/QEP4 for EVB) is the leading sequence.
Both edges of the pulses of the two quadrature encoded inputs are counted
by the QEP circuit. Therefore, the frequency of the clock generated by the QEP
logic to GP timer 2 (or 4) is four times that of each input sequence. This quadra-
tureclock is connected to the clock input of GP timer 2 (or 4).










