MOTOROLA
TIME PROCESSOR UNIT
MC68336/376
11-10
USER’S MANUAL
to 255). This provides an instantaneous or average pulse-width measurement capa-
bility, allowing the latest complete accumulation (over the specified number of periods)
to always be available in a parameter. By using the output compare function in con-
junction with PPWA, an output signal can be generated that is proportional to a spec-
ified input signal. The ratio of the input and output frequency is programmable. One or
more output signals with different frequencies, yet proportional and synchronized to a
single input signal, can be generated on separate channels.
Refer to TPU programming note
Period/Pulse-Width Accumulator (PPWA) TPU Func-
tion (TPUPN11/D) for more information.
11.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 CPU32 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 provides a time stamp referenced to TCR1 for every valid sig-
nal 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.
Refer to TPU programming note
Quadrature Decode (QDEC) TPU Function
(TPUPN20/D) for more information.
11.5 G Mask Set 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.
11.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.
336376UMBook Page 10 Friday, November 15, 1996 2:09 PM