Contents ............................Preface ......................... Introduction ........................Description ......................EQEP Inputs ....................Functional Description ..................... eQEP Memory Map ................... Quadrature Decoder Unit (QDU) ..................Position Counter Input Modes ..................eQEP Input Polarity Selection ..................Position-Compare Sync Output ................Position Counter and Control Unit (PCCU) ..................
Page 4
www.ti.com List of Figures ......................Optical Encoder Disk ............QEP Encoder Output Signal for Forward/Reverse Movement ......................Index Pulse Example ..............Functional Block Diagram of the eQEP Peripheral ................Functional Block Diagram of Decoder Unit ..................Quadrature Decoder State Machine ................
Page 5
www.ti.com List of Tables ....................... EQEP Memory Map ..................Quadrature Decoder Truth Table ........... eQEP Decoder Control (QDECCTL) Register Field Descriptions ..............eQEP Control (QEPCTL) Register Field Descriptions ......... eQEP Position-compare Control (QPOSCTL) Register Field Descriptions ............ eQEP Capture Control (QCAPCTL) Register Field Descriptions ...........
– Reserved bits in a register figure designate a bit that is used for future device expansion. Related Documentation From Texas Instruments The following books describe the TMS320x2833x/2823x devices and related support tools that are available on the TI website: Data Manual and Errata—...
Page 7
2833x devices. SPRUG04— TMS320x2833x, 2823x Enhanced Pulse Width Modulator (ePWM) Module Reference Guide describes the main areas of the enhanced pulse width modulator that include digital motor control, switch mode power supply control, UPS (uninterruptible power supplies), and other forms of power conversion.
Reference Guide SPRUG05A – August 2008 – Revised December 2008 Enhanced QEP (eQEP) Module The enhanced quadrature encoder pulse (eQEP) module is used for direct interface with a linear or rotary incremental encoder to get position, direction, and speed information from a rotating machine for use in a high-performance motion and position-control system.
Description www.ti.com Some typical applications of shaft encoders include robotics and even computer input in the form of a mouse. Inside your mouse you can see where the mouse ball spins a pair of axles (a left/right, and an up/down axle). These axles are connected to optical shaft encoders that effectively tell the computer how fast and in what direction the mouse is moving.
Description www.ti.com EQEP Inputs The eQEP inputs include two pins for quadrature-clock mode or direction-count mode, an index (or 0 marker), and a strobe input. • QEPA/XCLK and QEPB/XDIR These two pins can be used in quadrature-clock mode or direction-count mode. –...
Description www.ti.com Figure 4. Functional Block Diagram of the eQEP Peripheral System control registers To CPU EQEPxENCLK SYSCLKOUT QCPRD QCAPCTL QCTMR Quadrature capture unit QCTMRLAT (QCAP) QCPRDLAT QUTMR QWDTMR Registers used by QUPRD QWDPRD multiple units QEPCTL QEPSTS UTOUT UTIME QWDOG QDECCTL QFLG...
Quadrature Decoder Unit (QDU) www.ti.com 3.1.1 Quadrature Count Mode The quadrature decoder generates the direction and clock to the position counter in quadrature count mode. Direction Decoding— The direction decoding logic of the eQEP circuit determines which one of the sequences (QEPA, QEPB) is the leading sequence and accordingly updates the direction information in QEPSTS[QDF] bit.
Position Counter and Control Unit (PCCU) www.ti.com 3.1.4 Down-Count Mode The counter direction signal is hardwired for a down count and the position counter is used to measure the frequency of the QEPA input. Setting of the QDECCTL[XCR] bit enables clock generation to the position counter on both edges of a QEPA input, thereby increasing the measurement resolution by 2x factor.
Position Counter and Control Unit (PCCU) www.ti.com For example, if the first reset operation occurs on the falling edge of QEPB during the forward direction, then all the subsequent reset must be aligned with the falling edge of QEPB for the forward rotation and on the rising edge of QEPB for the reverse rotation as shown in Figure The position-counter value is latched to the QPOSILAT register and direction information is recorded in...
Position Counter and Control Unit (PCCU) www.ti.com Figure 9. Position Counter Underflow/Overflow (QPOSMAX = 4) QCLK QDIR QPOSCNT OV/UF QCLK QDIR QPOSCNT OV/UF 4.1.3 Position Counter Reset on the First Index Event (QEPCTL[PCRM] = 10) If the index event occurs during forward movement, then the position counter is reset to 0 on the next eQEP clock.
Position Counter and Control Unit (PCCU) www.ti.com Position Counter Latch The eQEP index and strobe input can be configured to latch the position counter (QPOSCNT) into QPOSILAT and QPOSSLAT, respectively, on occurrence of a definite event on these pins. 4.2.1 Index Event Latch In some applications, it may not be desirable to reset the position counter on every index event and instead it may be required to operate the position counter in full 32-bit mode (QEPCTL[PCRM] = 01 and...
Position Counter and Control Unit (PCCU) www.ti.com Figure 10. Software Index Marker for 1000-line Encoder (QEPCTL[IEL] = 1) QCLK QEPSTS:QDF QPOSCNT Index interrupt/ index event marker QPOSILAT QEPSTS:QDLF 4.2.2 Strobe Event Latch The position-counter value is latched to the QPOSSLAT register on the rising edge of the strobe input by clearing the QEPCTL[SEL] bit.
Position Counter and Control Unit (PCCU) www.ti.com Position Counter Initialization The position counter can be initialized using following events: • Index event • Strobe event • Software initialization Index Event Initialization (IEI)— The QEPI index input can be used to trigger the initialization of the position counter at the rising or falling edge of the index input.
Position Counter and Control Unit (PCCU) www.ti.com For example, if QPOSCMP = 2, the position-compare unit generates a position-compare event on 1 to 2 transitions of the eQEP position counter for forward counting direction and on 3 to 2 transitions of the eQEP position counter for reverse counting direction (see Figure 13).
eQEP Edge Capture Unit www.ti.com eQEP Edge Capture Unit The eQEP peripheral includes an integrated edge capture unit to measure the elapsed time between the unit position events as shown in Figure 15. This feature is typically used for low speed measurement using the following equation: v ( k ) + t ( k ) * t ( k * 1 )
eQEP Watchdog www.ti.com Parameter Relevant Register to Configure or Read the Information Unit Period Register (QUPRD) ∆X Incremental Position = QPOSLAT(k) - QPOSLAT(K-1) Fixed unit position defined by sensor resolution and ZCAPCTL[UPPS] bits ∆T Capture Period Latch (QCPRDLAT) eQEP Watchdog The eQEP peripheral contains a 16-bit watchdog timer that monitors the quadrature-clock to indicate proper operation of the motion-control system.
eQEP Registers www.ti.com Table 4. eQEP Control (QEPCTL) Register Field Descriptions (continued) Bits Name Value Description Strobe event latch of position counter The position counter is latched on the rising edge of QEPS strobe (QPOSSLAT = POSCCNT). Latching on the falling edge can be done by inverting the strobe input using the QSP bit in the QDECCTL register.
eQEP Registers www.ti.com Table 5. eQEP Position-compare Control (QPOSCTL) Register Field Descriptions (continued) Name Description Load when QPOSCNT = QPOSCMP PCPOL Polarity of sync output Active HIGH pulse output Active LOW pulse output Position-compare enable/disable Disable position compare unit Enable position compare unit 11-0 PCSPW Select-position-compare sync output pulse width...
eQEP Registers www.ti.com Figure 25. eQEP Position Counter (QPOSCNT) Register QPOSCNT R/W-0 LEGEND: R/W = Read/Write; R = Read only; -n = value after reset Table 7. eQEP Position Counter (QPOSCNT) Register Field Descriptions Bits Name Description 31-0 QPOSCNT This 32-bit position counter register counts up/down on every eQEP pulse based on direction input.
eQEP Registers www.ti.com Table 10. eQEP Position-compare (QPOSCMP) Register Field Descriptions Bits Name Description 31-0 QPOSCMP The position-compare value in this register is compared with the position counter (QPOSCNT) to generate sync output and/or interrupt on compare match. Figure 29. eQEP Index Position Latch (QPOSILAT) Register QPOSILAT LEGEND: R/W = Read/Write;...
eQEP Registers www.ti.com Figure 32. eQEP Unit Timer (QUTMR) Register QUTMR R/W-0 LEGEND: R/W = Read/Write; R = Read only; -n = value after reset Table 14. eQEP Unit Timer (QUTMR) Register Field Descriptions Bits Name Description 31-0 QUTMR This register acts as time base for unit time event generation. When this timer value matches with unit time period value, unit time event is generated.
eQEP Registers www.ti.com Table 17. eQEP Watchdog Period (QWDPRD) Register Field Description Bits Name Value Description 15-0 QWDPRD This register contains the time-out count for the eQEP peripheral watch dog timer. When the watchdog timer value matches the watchdog period value, a watchdog timeout interrupt is generated.
eQEP Registers www.ti.com Table 19. eQEP Interrupt Flag (QFLG) Register Field Descriptions (continued) Bits Name Value Description Quadrature direction change interrupt flag No interrupt generated This bit is set during change of direction Quadrature phase error interrupt flag No interrupt generated Set on simultaneous transition of QEPA and QEPB Position counter error interrupt flag No interrupt generated...
eQEP Registers www.ti.com Table 20. eQEP Interrupt Clear (QCLR) Register Field Descriptions (continued) Field Value Description Clear position counter underflow interrupt flag No effect Clears the interrupt flag Clear watchdog timeout interrupt flag No effect Clears the interrupt flag Clear quadrature direction change interrupt flag No effect Clears the interrupt flag Clear quadrature phase error interrupt flag...
eQEP Registers www.ti.com Table 21. eQEP Interrupt Force (QFRC) Register Field Descriptions (continued) Field Value Description Force position-compare ready interrupt No effect Force the interrupt Force position counter overflow interrupt No effect Force the interrupt Force position counter underflow interrupt No effect Force the interrupt Force watchdog time out interrupt...
eQEP Registers www.ti.com Table 22. eQEP Status (QEPSTS) Register Field Descriptions (continued) Field Value Description QDLF eQEP direction latch flag Status of direction is latched on every index event marker. Counter-clockwise rotation (or reverse movement) on index event marker Clockwise rotation (or forward movement) on index event marker COEF Capture overflow error flag Sticky bit, cleared by writing 1...
eQEP Registers www.ti.com Table 25. eQEP Capture Timer Latch (QCTMRLAT) Register Field Descriptions Bits Name Description 15-0 QCTMRLAT The eQEP capture timer value can be latched into this register on two events viz., unit timeout event, reading the eQEP position counter. Figure 44.
IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete.
Need help?
Do you have a question about the TMS320x2833x and is the answer not in the manual?
Questions and answers