SPRAC77E January 2022 – February 2022 TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S
The QCLK state machine has two functions: (1) keep a copy of the previous levels of QEP-A and QEP-B, and (2) detect a valid QEP state change and enable the position counter to increment or decrement.
To create a copy of the previous QEP-A and QEP-B signals the following state equations are used:
To determine if a valid QEP state change has occurred, the previous QEP-A/B values are compared to the current values. When a valid QEP state transition is detected, the FSM will pull QCLK high. This signal enables the position counter allowing it to increment or decrement depending on the DIRECTION signal.
There are four possible cases which are mapped in Table 5-4:
The resulting equations, combined by the OR operator, are entered into the CLB tool for the output of the FSM.
Current State e0, e1 QEP-A(n), B(n) |
|||||
00 | 01 | 11 | 10 | ||
Previous State s0, s1 QEP-A(n-1), B(n-1) |
00 | 0 No movement |
1 (2) Reverse |
0 Invalid |
1 (4) Forward |
01 | 1 (1) Forward |
0 No movement |
1 (3) Reverse |
0 Invalid |
|
11 | 0 Invalid |
1 (2) Forward |
0 No movement |
1 (4) Reverse |
|
10 | 1 (1) Reverse |
0 Invalid |
1 (3) Forward |
0 No movement |