QPOSCTL:PCSPW
8
Pulse
stretcher
QFLG:PCM
QPOSCNT
32
QPOSCMP
QFLG:PCR
32
QPOSCTL:PCSHDW
QPOSCTL:PCLOAD
0
1
QPOSCTL:PCPOL
PCSOUT
PCEVENT
Enhanced Quadrature Encoder Pulse (eQEP) Module
15.4.2.4.3 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.
If the QEPCTL[IEI] bits are 10, then the position counter (QPOSCNT) is initialized with a value in
the QPOSINIT register on the rising edge of strobe input for forward direction and on the falling
edge of strobe input for reverse direction.
The index event initialization interrupt flag (QFLG[IEI]) is set when the position counter is initialized
with a value in the QPOSINIT register.
Strobe Event Initialization (SEI)— If the QEPCTL[SEI] bits are 10, then the position counter is initialized
with a value in the QPOSINIT register on the rising edge of strobe input.
If the QEPCTL[SEL] bits are 11, then the position counter (QPOSCNT) is initialized with a value in
the QPOSINIT register on the rising edge of strobe input for forward direction and on the falling
edge of strobe input for reverse direction.
The strobe event initialization interrupt flag (QFLG[SEI]) is set when the position counter is
initialized with a value in the QPOSINIT register.
Software Initialization (SWI)— The position counter can be initialized in software by writing a 1 to the
QEPCTL[SWI] bit, which will automatically be cleared after initialization.
15.4.2.4.4 eQEP Position-compare Unit
The eQEP peripheral includes a position-compare unit that is used to generate a sync output and/or
interrupt on a position-compare match.
shows a diagram. The position-compare
(QPOSCMP) register is shadowed and shadow mode can be enabled or disabled using the
QPOSCTL[PSSHDW] bit. If the shadow mode is not enabled, the CPU writes directly to the active position
compare register.
Figure 15-140. eQEP Position-compare Unit
In shadow mode, you can configure the position-compare unit (QPOSCTL[PCLOAD]) to load the shadow
register value into the active register on the following events and to generate the position-compare ready
(QFLG[PCR]) interrupt after loading.
•
Load on compare match
•
Load on position-counter zero event
1664
Pulse-Width Modulation Subsystem (PWMSS)
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated