The eQEP inputs include two pins for
quadrature-clock mode or direction-count mode, an index (or 0 marker), and a strobe
input. The eQEP module requires that the QEPA, QEPB, and QEPI inputs are
synchronized to SYSCLK prior to entering the module. The application code can enable
the synchronous GPIO input feature on any eQEP-enabled GPIO pins (see the General-Purpose Input/Output (GPIO) chapter for more details).
- QEPA/XCLK and QEPB/XDIR: These two pins can be used in
quadrature-clock mode or direction-count mode.
- Quadrature-clock Mode:
The eQEP encoders provide two square wave signals (A and B) 90
electrical degrees out of phase. This phase relationship is used to
determine the direction of rotation of the input shaft and number of
eQEP pulses from the index position to derive the relative position
information. For forward or clockwise rotation, QEPA signal leads QEPB
signal and conversely. The quadrature decoder uses these two inputs to
generate quadrature-clock and direction signals.
- Direction-count Mode: In
direction-count mode, direction and clock signals are provided directly
from the external source. Some position encoders have this type of
output instead of quadrature output. The QEPA pin provides the clock
input and the QEPB pin provides the direction input.
- QEPI: Index or Zero Marker:
The eQEP encoder uses an index signal to assign an absolute start position
from which position information is incrementally encoded using quadrature
pulses. This pin is connected to the index output of the eQEP encoder to
optionally reset the position counter for each revolution. This signal can be
used to initialize or latch the position counter on the occurrence of a desired
event on the index pin.
- QEPS: Strobe Input: This
general-purpose strobe signal can initialize or latch the position counter on
the occurrence of a desired event on the strobe pin. This signal is typically
connected to a sensor or limit switch to notify that the motor has reached a
defined position.
Input signals to the eQEP (QEPA,
QEPB, QEPI and QEPS) can come from multiple sources; that is, device pin,
CMPSSx, or PWMXBARx. One typical use case is if SinCos transducers are used in
the motor control system to estimate the position of motor shaft and Index
signal is coming from traditional rotary encoder, source of the eQEP signals
(QEPA, QEPB and QEPI) can be configured as output of CMPSSx that decodes the
Sin, Cos, and Index signals. Figure 21-4 illustrates the use case.
Selection of the source of Input signals (QEPA, QEPB, and QEPI) is
user-configurable through the QEPSRCSEL register as shown in Table 21-1.
Table 21-1 eQEP Input Source Select Table
QEPASEL, QEPBSEL, QEPISEL |
Input Signal |
0
|
DEVICE_PIN
|
1
|
CMPSS1_CTRIPH
|
2
|
CMPSS2_CTRIPH
|
3
|
CMPSS3_CTRIPH
|
4
|
CMPSS4_CTRIPH
|
5-7
|
Reserved
|
8
|
ZERO
|
9
|
EPWMXBAR1
|
10
|
EPWMXBAR2
|
11
|
EPWMXBAR3
|
12
|
EPWMXBAR4
|
13
|
EPWMXBAR5
|
14
|
EPWMXBAR6
|
15
|
EPWMXBAR7
|
Note: Configuration of QEPSRCSEL register to select the source of QEPA, QEPB, and QEPI
signals can lead to unexpected transition on these signals, which can cause an
undesirable outcome if eQEP is already running. Make sure that the eQEP is disabled
before configuring the QEPSRCSEL register for input signals.