7.5.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 index input. Conversely, if the QEPCTL[IEI] bits are 11, initialization will be on the falling
edge of the index input.
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 QEPCTL[SEL] bits are 11, then the position counter 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.
Software
Initialization
(SWI)
The position counter can be initialized in software by writing a 1 to the QEPCTL[SWI] bit.
This bit is not automatically cleared. While the bit is still set, if a 1 is written to it again, the
position counter will be re-initialized.
7.5.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.
QPOSCTL:PCSPW
12
Pulse
stretcher
QFLG:PCM
QPOSCNT
32
QPOSCMP
QFLG:PCR
32
QPOSCTL:PCSHDW
QPOSCTL:PCLOAD
0
1
QPOSCTL:PCPOL
PCSOUT
PCEVENT
Figure 7-12. 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
Enhanced Quadrature Encoder Pulse (eQEP)
476
TMS320x2806x Microcontrollers
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
Copyright © 2022 Texas Instruments Incorporated
Summary of Contents for TMS320 2806 Series
Page 2: ......