SWRU626 December 2025 CC3501E , CC3551E
The Phase A (PHA), Phase B (PHB) and IDX signals are input events of channel 0, channel 1 and channel 2 respectively. PHA and PHB are required and IDX is optional. The signals are typically provided from an incremental encoder. An incremental encoder can provide two outputs which indicate a linear or a rotary motion. The output of the incremental encoder is typically a 90º shifted square wave and is provided as an input to the GPT. When enabled in QDEC mode, the GPT is used to decode the quadrature encoded data to provide information on the relative positioning and movement of a linear or rotary motion. The accumulation of the counter value in GPT with respect to PHA/PHB follows the following table:
| Previous Pin Event | Current Pin Event | Counter (+ or -) | Direction |
|---|---|---|---|
| PHA Falling | PHB Rising | - | Down |
| PHA Falling | PHB Falling | + | Up |
| PHA Falling | PHA Rising | + if new dir is up, - if new dir is down | Toggle |
| PHA Rising | PHB Rising | + | Up |
| PHA Rising | PHB Falling | - | Down |
| PHA Rising | PHA Falling | + if new dir is up, - if new dir is down | Toggle |
| PHB Falling | PHA Rising | + | Up |
| PHB Falling | PHA Falling | - | Down |
| PHB Falling | PHB Rising | + if new dir is up, - if new dir is down | Toggle |
| PHB Rising | PHA Rising | - | Down |
| PHB Rising | PHA Falling | + | Up |
| PHB Rising | PHB Falling | + if new dir is up, - if new dir is down | Toggle |
To setup GPT in QDEC mode follow these steps:
Figure 13-8 shows the QDEC related signals with PREEVENT.