Hi Surendra, 1. The eQEP capture unit is used for low-speed measurement by measuring the elapsed time (ΔT) between unit position events (ΔX) using the capture timer (QCTMR) and capture period register (QCPRD). 2. The velocity calculation formula is: v(k) = ΔX/ΔT Where ΔX is the incremental position movement and ΔT is the incremental time elapsed for that position change. 3. The unit position event (ΔX) is defined by the number of quadrature periods selected using the QCAPCTL[UPPS] bits. This essentially scales/prescales the QCLK input to the capture unit to define the unit position. 4. The capture timer (QCTMR) is clocked by a prescaled version of SYSCLKOUT, where the prescaler is set by QCAPCTL[CCPS] bits. This scales the capture timer clock frequency. 5. For high-speed measurement, the unit timer base (QUTMR) running at SYSCLKOUT is used to generate periodic interrupts for velocity calculation using the formula: v(k) = ΔX/T, where T is the unit time period set in QUPRD. So in the example code, FREQ_SCALER_PR and FREQ_SCALER_FR may be scaling factors applied to the calculated frequency/velocity values based on how the QCAPCTL[UPPS], QCAPCTL[CCPS] and QUPRD registers are configured for the specific application requirements. The dividers compensate for the effective resolution, unit position size, and sample rate used. Best, Ryan Ma
↧