Clr
Set
Latch
QFRC:PCE
PCE
QCLR:PCE
QFLG:PCE
QEINT:PCE
QCLR:UTO
QFRC:UTO
QEINT:UTO
set
Latch
clr
UTO
QFLG:UTO
0
1
0
Pulse
generator
when
input=1
QFLG:INT
Latch
Set
Clr
QCLR:INT
EQEPxINT
eQEP Interrupt Structure
877
SPRUHE8E – October 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
C28 Enhanced QEP (eQEP) Module
9.8
eQEP Interrupt Structure
shows how the interrupt mechanism works in the EQEP module.
Figure 9-20. EQEP Interrupt Generation
Eleven interrupt events (PCE, PHE, QDC, WTO, PCU, PCO, PCR, PCM, SEL, IEL and UTO) can be
generated. The interrupt control register (QEINT) is used to enable/disable individual interrupt event
sources. The interrupt flag register (QFLG) indicates if any interrupt event has been latched and contains
the global interrupt flag bit (INT). An interrupt pulse is generated only to the PIE if any of the interrupt
events is enabled, the flag bit is 1 and the INT flag bit is 0. The interrupt service routine will need to clear
the global interrupt flag bit and the serviced event, via the interrupt clear register (QCLR), before any other
interrupt pulses are generated. You can force an interrupt event by way of the interrupt force register
(QFRC), which is useful for test purposes.
9.9
eQEP Registers
Figure 9-21. QEP Decoder Control (QDECCTL) Register
15
14
13
12
11
10
9
8
QSRC
SOEN
SPSEL
XCR
SWAP
IGATE
QAP
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
7
6
5
4
0
QBP
QIP
QSP
Reserved
R/W-0
R/W-0
R/W-0
R-0
LEGEND: R/W = Read/Write; R = Read only; -
n
= value after reset
Table 9-3. eQEP Decoder Control (QDECCTL) Register Field Descriptions
Bits
Name
Value
Description
15-14
QSRC
Position-counter source selection
00
Quadrature count mode (QCLK = iCLK, QDIR = iDIR)
01
Direction-count mode (QCLK = xCLK, QDIR = xDIR)
10
UP count mode for frequency measurement (QCLK = xCLK, QDIR = 1)
11
DOWN count mode for frequency measurement
(QCLK = xCLK, QDIR = 0)
13
SOEN
Sync output-enable
0
Disable position-compare sync output
1
Enable position-compare sync output