7.6 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
. This feature is typically used for low-speed measurement using the
following formula:
v(k)
+
X
t(k)
*
t(k
*
1)
+
X
D
T
(3)
where:
• X = Unit position is defined by integer multiple of quadrature edges (see
• ΔT = Elapsed time between unit position events
• v(k) = Velocity at time instant "k"
The eQEP capture timer (QCTMR) runs from prescaled SYSCLKOUT and the prescaler is programmed by the
QCAPCTL[CCPS] bits. The capture timer (QCTMR) value is latched into the capture period register (QCPRD)
on every unit position event and then the capture timer is reset, a flag is set in QEPSTS:UPEVNT to indicate
that new value is latched into the QCPRD register. Software can check this status flag before reading the period
register for low speed measurement, and clear the flag by writing 1.
Time measurement (ΔT) between unit position events will be correct if the following conditions are met:
• No more than 65,535 counts have occurred between unit position events.
• No direction change between unit position events.
If the QEP capture timer overflows between unit position events, then it sets the QEP capture overflow flag
(QEPSTS[COEF]) in the status register and the QCPRDLAT register is set to 0xFFFF. If direction change occurs
between the unit position events, then the error flag is set in the status register (QEPSTS[CDEF]) and the
QCPRDLAT register is set to 0xFFFF.
The Capture Timer (QCTMR) and Capture Period register (QCPRD) can be configured to latch on following
events.
• CPU read of QPOSCNT register
• Unit time-out event
If the QEPCTL[QCLM] bit is cleared, then the capture timer and capture period values are latched into the
QCTMRLAT and QCPRDLAT registers, respectively, when the CPU reads the position counter (QPOSCNT).
If the QEPCTL[QCLM] bit is set, then the position counter, capture timer, and capture period values are latched
into the QPOSLAT, QCTMRLAT and QCPRDLAT registers, respectively, on unit time out.
shows the capture unit operation along with the position counter.
Enhanced Quadrature Encoder Pulse (eQEP)
478
TMS320x2806x Microcontrollers
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......