![Freescale Semiconductor MPC5632M Manual Download Page 671](http://html.mh-extra.com/html/freescale-semiconductor/mpc5632m/mpc5632m_manual_2330659671.webp)
MPC563XM Reference Manual, Rev. 1
Freescale Semiconductor
671
Preliminary—Subject to Change Without Notice
Figure 22-40. Pulse/Edge Counting single-shot mode example
22.5.1.1.9
Quadrature Decode (QDEC) Mode
Quadrature decode mode uses UC[n] operating in QDEC mode and the input programmable filter (IPF)
from UC[n-1]. Note that UC[n-1] can be configured, at the same time, to an operation mode that does not
use I/O pins, such as MC mode (modulus counter). The connection among the UCs is circular, i.e., when
UC[0] is running in QDEC mode, the input programmable filter from UC[23] is being used.
This mode generates a FLAG every time the internal counter matches A1 register. The internal counter is
automatically selected and is not cleared when entering this mode.
MODE[6] bit selects which type of encoder will be used:
count & direction
encoder or
phase_A &
phase_B
encoders.
When operating with
count & direction
encoder (MODE[6] cleared), UC[n] input pin must be connected
to the
direction
signal and UC[n-1] input pin must be connected to the
count
signal of the quadrature
encoder. UC[n] EDPOL bit selects count direction according to
direction
signal and UC[n-1] EDPOL bit
selects if the internal counter is clocked by the rising or falling edge of the
count
signal.
When operating with
phase_A & phase_B
encoder (MODE[6] set), UC[n] input pin must be connected to
the
phase_A
signal and UC[n-1] input pin must be connected to the
phase_B
signal of the quadrature
encoder. EDPOL bit selects the count direction according to the phase difference between
phase_A &
phase_B
signals.
show two Unified Channels configured to quadrature decode mode for
count & direction
encoder and
phase_A & phase_B
encoders, respectively.
amount of events detected
$000000
EMIOSCNT[n]
Time
B1 Match
Flag pin/register
A1 B1 write
selected counter bus
$000303
$000090
$000303
$000090
A1 value
1
$000090
$000090
B1 Match
A1 match
amount of events detected
B1 value
2
$000303
$000303
$000303
A1 Match
$000090
Notes: 1. EMIOSA[n] = A1
2. EMIOSB[n] = B1
MODE
[6]
= 1
A2 value
3
A2 EMIOSCNT[n]
A2 EMIOSCNT[n]
3 EMIOSALTA[n] = A2