MC68332
TIME PROCESSOR UNIT
USER’S MANUAL
7-9
allowing the latest complete accumulation (over the specified number of periods) to al-
ways be available in a parameter. By using the output compare function in conjunction
with PPWA, an output signal can be generated that is proportional to a specified input
signal. The ratio of the input and output frequency is programmable. One or more out-
put signals with different frequencies, yet proportional and synchronized to a single in-
put signal, can be generated on separate channels.
7.4.11 Quadrature Decode (QDEC)
The quadrature decode function uses two channels to decode a pair of out-of-phase
signals in order to present the CPU with directional information and a position value.
It is particularly suitable for use with slotted encoders employed in motor control. The
function derives full resolution from the encoder signals and provides a 16-bit position
counter with rollover/under indication via an interrupt.
The counter in parameter RAM is updated when a valid transition is detected on either
one of the two inputs. The counter is incremented or decremented depending on the
lead/lag relationship of the two signals at the time of servicing the transition. The user
can read or write the counter at any time. The counter is free running, overflowing to
$0000 or underflowing to $FFFF depending on direction. The QDEC function also pro-
vides a time stamp referenced to TCR1 for every valid signal edge and the ability for
the host CPU to obtain the latest TCR1 value. This feature allows position interpolation
by the host CPU between counts at very slow count rates.
7.5 Motion Control Time Functions
The following paragraphs describe factory-programmed time functions implemented
in the motion-control microcode ROM. A complete description of the functions is be-
yond the scope of this manual. Refer to the
TPU Reference Manual (TPURM/AD) for
additional information.
7.5.1 Table Stepper Motor (TSM)
The TSM function provides for acceleration and deceleration control of a stepper mo-
tor with a programmable number of step rates up to 58. TSM uses a table in parameter
RAM, rather than an algorithm, to define the stepper motor acceleration profile, allow-
ing the user to fully define the profile. In addition, a slew rate parameter allows fine
control of the terminal running speed of the motor independent of the acceleration ta-
ble. The CPU need only write a desired position, and the TPU accelerates, slews, and
decelerates the motor to the required position. Full and half step support is provided
for two-phase motors. In addition, a slew rate parameter allows fine control of the ter-
minal running speed of the motor independent of the acceleration table.
7.5.2 New Input Capture/Transition Counter (NITC)
Any channel of the TPU can capture the value of a specified TCR or any specified lo-
cation in parameter RAM upon the occurrence of each transition or specified number
of transitions, and then generate an interrupt request to notify the bus master. The
times of the most recent two transitions are maintained in parameter RAM. A channel
can perform input captures continually, or a channel can detect a single transition or
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..