mc68hc916y3 Freescale Semiconductor, Inc, mc68hc916y3 Datasheet - Page 317

no-image

mc68hc916y3

Manufacturer Part Number
mc68hc916y3
Description
Mc68hc16y3 16 Bit Microcontroller
Manufacturer
Freescale Semiconductor, Inc
Datasheet
14.4.8 Position-Synchronized Pulse Generator (PSP)
14.4.9 Stepper Motor (SM)
MC68HC16Y3/916Y3
USER’S MANUAL
Refer to TPU programming note Period Measurement, Missing Transition Detect
(PMM) TPU Function (TPUPN15B/D) for more information.
Any channel of the TPU2 can generate an output transition or pulse, which is a projec-
tion in time based on a reference period previously calculated on another channel.
Both TCRs are used in this algorithm: TCR1 is internally clocked, and TCR2 is clocked
by a position indicator in the user's device. An example of a TCR2 clock source is a
sensor that detects special teeth on the flywheel of an automobile using PMA or PMM.
The teeth are placed at known degrees of engine rotation; hence, TCR2 is a coarse
representation of engine degrees. For example, each count represents some number
of degrees.
Up to 15 position-synchronized pulse generator function channels can operate with a
single input reference channel executing a PMA or PMM input function. The input
channel measures and stores the time period between the flywheel teeth and resets
TCR2 when the engine reaches a reference position. The output channel uses the pe-
riod calculated by the input channel to project output transitions at specific engine de-
grees. Because the flywheel teeth might be 30 or more degrees apart, a fractional
multiplication operation resolves down to the desired degrees. Two modes of opera-
tion allow pulse length to be determined either by angular position or by time.
Refer to TPU programming note Position-Synchronized Pulse Generator (PSP) TPU
Function (TPUPN14/D) for more information.
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 CPU16 issues a
step request. Next, the TPU2 steps the motor to the desired position through an accel-
eration/deceleration profile defined by parameters. The parameter indicating the de-
sired position can be changed by the CPU16 while the TPU2 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 CPU16 for each channel defines the output state
of the associated pin. The bit pattern written by the CPU16 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.
Freescale Semiconductor, Inc.
For More Information On This Product,
TIME PROCESSOR UNIT 2
Go to: www.freescale.com
P r
=
K1 K2
r
MOTOROLA
14-9

Related parts for mc68hc916y3