SPRUJ28E November 2021 – September 2024 AM68 , AM68A , TDA4AL-Q1 , TDA4VE-Q1 , TDA4VL-Q1
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-288 and Figure 12-231 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-232 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-231 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-232.
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 |
QB↓ | DOWN | Decrement | |
QA↓ | TOGGLE | Increment or Decrement | |
QA↓ | QB↓ | UP | Increment |
QB↑ | DOWN | Decrement | |
QA↑ | TOGGLE | Increment or Decrement | |
QB↑ | QA↑ | DOWN | Increment |
QA↓ | UP | Decrement | |
QB↓ | TOGGLE | Increment or Decrement | |
QB↓ | QA↓ | DOWN | Increment |
QA↑ | UP | Decrement | |
QB↑ | TOGGLE | Increment or Decrement |