English
Language : 

PXR40RM Datasheet, PDF (775/1434 Pages) Freescale Semiconductor, Inc – PXR40 Microcontroller
Enhanced Modular Input/Output Subsystem (eMIOS200)
23.4.1.1.9 Quadrature Decode (QDEC) Mode
QDEC 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 modulus counter mode (MC). The connection among the unified channels is circular,
i.e., when UC[0] is running in QDEC mode, the input programmable filter from UC[31] 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 is used: count & direction encoder or phase_A & phase_B
encoder.
When operating with count & direction encoder (MODE[6] cleared), the UC[n] input pin must be
connected to the direction signal and the UC[n – 1] input pin must be connected to the count signal of the
quadrature encoder. The EDPOL bit for UC[n] selects the count direction according to the direction signal
and the EDPOL bit for UC[n – 1] selects whether 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), the UC[n] input pin must be connected
to the phase_A signal and the UC[n – 1] input pin must be connected to the phase_B signal of the
quadrature encoder. The EDPOL bit selects the count direction according to the phase difference between
phase_A & phase_B signals.
Figure 23-29 and Figure 23-30 show two unified channels configured to quadrature decode mode for
count & direction encoder and phase_A & phase_B encoders, respectively.
MODE[6] = 0
EDPOL = 1
Direction (from UC[n])
Count (from UC[n – 1])
EMIOS_CCNTR[n] inc/dec
+1 +1 +1 +1 +1 +1 +1 +1 –1 –1 –1 –1 –1
EMIOS_CCNTR[n]
A1 Write A1 Match
(Value 1)
A1 Match
Value 1
0x000000
FLAG Pin/Register
Time
Note: EMIOS_CADR[n]  A1
Figure 23-29. QDEC Mode Example with Count & Direction Encoder
Freescale Semiconductor
PXR40 Microcontroller Reference Manual, Rev. 1
23-35