SPRUIM2H May 2020 – October 2023 AM2431 , AM2432 , AM2434 , AM6411 , AM6412 , AM6421 , AM6422 , AM6441 , AM6442
The quadrature decoder generates the direction and clock to the position counter in quadrature count mode.
The direction decoding logic of the EQEP circuit determines which one of the sequences (EQEPA, EQEPB) is the leading sequence and accordingly updates the direction information in the QDF bit in the EQEP status register (EQEP_QEP_STS_CT). Table 12-4408 and Figure 12-2311 show the direction decoding logic in truth table and state machine form. Both edges of the EQEPA and EQEPB signals are sensed to generate count pulses for the position counter. Therefore, the frequency of the clock generated by the EQEP logic is four times that of each input sequence. Figure 12-2312 shows the direction decoding and clock generation from the EQEP input signals.
In normal operating conditions, quadrature inputs EQEPA and EQEPB will be 90 degrees out of phase. The phase error flag (QPEI_FLG) is set in the EQEP_QINT_EN_FLG register when edge transition is detected simultaneously on the EQEPA and EQEPB signals to optionally generate interrupts. State transitions marked by dashed lines in Figure 12-2311 are invalid transitions that generate a phase error.
The EQEP position counter provides 4× times the resolution of an input clock by generating a quadrature-clock (QCLK) on the rising/falling edges of both EQEP input clocks (EQEPA and EQEPB) as shown in Figure 12-2312.
In normal quadrature count operation, EQEPA input is fed to the QA input of the quadrature decoder and the EQEPB input is fed to the QB input of the quadrature decoder. Reverse counting is enabled by setting the SWAP bit in the EQEP decoder and control register (EQEP_QDEC_QEP_CTL). This will swap the input to the quadrature decoder thereby reversing the counting direction.
Previous Edge | Present Edge | QDIR | QPOSCNT |
---|---|---|---|
QA↑ | QB↑ | UP | Increment (+1) |
QB↓ | DOWN | Decrement (-1) | |
QA↓ | TOGGLE | Increment (+1) or Decrement (-1) | |
QA↓ | QB↓ | UP | Increment (+1) |
QB↑ | DOWN | Decrement (-1) | |
QA↑ | TOGGLE | Increment (+1) or Decrement (-1) | |
QB↑ | QA↑ | DOWN | Decrement (-1) |
QA↓ | UP | Increment (+1) | |
QB↓ | TOGGLE | Increment (+1) or Decrement (-1) | |
QB↓ | QA↓ | DOWN | Decrement (-1) |
QA↑ | UP | Increment (+1) | |
QB↑ | TOGGLE | Increment (+1) or Decrement (-1) |