MC68336/376
TIME PROCESSOR UNIT
MOTOROLA
USER’S MANUAL
Rev. 15 Oct 2000
11-9
Refer to TPU programming note Position-Synchronized Pulse Generator (PSP)
TPU Function (TPUPN14/D) for more information.
11.4.9 Stepper Motor (SM)
The stepper motor control algorithm provides for linear acceleration and deceleration
control of a stepper motor with a programmable number of step rates of up to 14. Any
group of channels, up to eight, can be programmed to generate the control logic nec-
essary to drive a stepper motor.
The time period between steps (P) is defined as:
where r is the current step rate (1–14), and K1 and K2 are supplied as parameters.
After providing the desired step position in a 16-bit parameter, the CPU32 issues a
step request. Next, the TPU steps the motor to the desired position through an accel-
eration/deceleration profile defined by parameters. The parameter indicating the
desired position can be changed by the CPU32 while the TPU is stepping the motor.
This algorithm changes the control state every time a new step command is received.
A 16-bit parameter initialized by the CPU32 for each channel defines the output state
of the associated pin. The bit pattern written by the CPU32 defines the method of step-
ping, such as full stepping or half stepping. With each transition, the 16-bit parameter
rotates one bit. The period of each transition is defined by the programmed step rate.
Refer to TPU programming note Stepper Motor (SM) TPU Function (TPUPN13/D)
for more information.
11.4.10 Period/Pulse-Width Accumulator (PPWA)
The period/pulse-width accumulator algorithm accumulates a 16-bit or 24-bit sum of
either the period or the pulse width of an input signal over a programmable number of
periods or pulses (from one to 255). After an accumulation period, the algorithm can
generate a link to a sequential block of up to eight channels. The user specifies a start-
ing channel of the block and number of channels within the block. Generation of links
depends on the mode of operation. Any channel can be used to measure an accumu-
lated number of periods of an input signal. A maximum of 24 bits can be used for the
accumulation parameter. From one to 255 period measurements can be made and
summed with the previous measurement(s) before the TPU interrupts the CPU, allow-
ing instantaneous or average frequency measurement, and the latest complete
accumulation (over the programmed number of periods).
The pulse width (high-time portion) of an input signal can be measured (up to 24 bits)
and added to a previous measurement over a programmable number of periods (one
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
Pr
()
K1
K2
–
r
=