The enhanced Quadrature Encoder Pulse (eQEP) module can be used to read information about speed and direction from an encoder for rotary machines. Therefore, the encoder needs to provide two signals that are shifted 90° out of phase from each other: QEPA and QEPB. Furthermore the amount of lines for rotary detection of the encoder needs to be known.
The TMS302F28335 offers two eQEP-Interfaces: eQEP1 and eQEP2. Each Interface supports up to 4 Pins: QEPA, QEPB, QEPI, QEPS. The implementation of eQEP in this library only uses QEPA and QEPB of one module.
eQEP_getDirection() returns 0 for Counter-clockwise rotation (or reverse movement) and 1 for Clockwise rotation (or forward movement).
eQEP_getRpm() returns the speed in revolution per minute.
QEPA | QEPB | |
---|---|---|
eQEP1 | GPIO20 | GPIO21 |
eQEP2 | GPIO24 | GPIO25 |