SPRAC77E January 2022 – February 2022 TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S
A QEP decoder intreprets a pulse train output from an incremental encoder. A basic QEP pulse train consists of the signals QEP-A, QEP-B, and QEP-I as shown in Figure 5-3. These signals have the following characteristics:
Design approach:
Decoder Function | CLB Block Mapping |
---|---|
32-bit position counter | Maps directly to the CLB 32-bit counter module. By connecting match1 and match2 to reset and an event, a count between 0 and a maximum position (MAXPOS) can be achieved. |
Memory of the past state | Detection of a valid state transition, direction and error all depend on the past state of QEP-A/B. This maps to an FSM which has the ability to store the past state. |
Comparison between past and present state | Once the past state is available from an FSM, comparison of the current and previous state can be accomplished by a LUT. If a LUT is not available, then an FSM can also provide this functionality. Making a comparison is required for both direction detection and error detection. |
Interrupt and counter capture | Capturing the counter value and interrupting the CPU maps to the functionality of the HLC. |
CPU input to the decoder such as reset and enable | Control bits from the CPU route through the GPREG to a LUT and combined (either OR or AND) with other system signals. |