SWCU193A April 2023 – August 2024 CC2340R2 , CC2340R5 , CC2340R5-Q1
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 LGPT. When enabled in QDEC mode, the LGPT 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 LGPT 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 direction is up, - if new direction is down | Toggle |
PHA Rising | PHB Rising | + | Up |
PHA Rising | PHB Falling | - | Down |
PHA Rising | PHA Falling | + if new direction is up, - if new direction is down | Toggle |
PHB Falling | PHA Rising | + | Up |
PHB Falling | PHA Falling | - | Down |
PHB Falling | PHB Rising | + if new direction is up, - if new direction is down | Toggle |
PHB Rising | PHA Rising | - | Down |
PHB Rising | PHA Falling | + | Up |
PHB Rising | PHB Falling | + if new direction is up, - if new direction is down | Toggle |
To setup LGPT in QDEC mode follow these steps:
.
Figure 10-8 shows the QDEC-related signals with PREEVENT.