AN2364 Freescale Semiconductor / Motorola, AN2364 Datasheet - Page 16

no-image

AN2364

Manufacturer Part Number
AN2364
Description
Using the Table Stepper Motor TPU Function (TSM) with the MPC500 Family
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
void tpu_tsm_mov
The function does not return any values from initialization. Except for DESIRED_POSITION, the
parameters of this initialization function must not be changed while the TSM function is operating. After
initialization, the parameter table channels will never be rewritten. Only the master channel will be accessed
for any future control commands of the TSM function.
7.2
This routine is the only control sent to the TSM function after initialization. Basically, this function will
designate where to move the stepper motor. This is accomplished with the following input parameters:
After the new DESIRED_POSITION is written to the internal register, a call is made which will move the
TSM until there is a match between the CURRENT_POSITION and the DESIRED_POSITION. Also, the
move function can be called at any time; even while the motor is stepping towards another value. The TSM
function will automatically take care of slowing the motor, reversing the direction (if necessary), and
accelerating towards the new DESIRED_POSITION as needed.
16
start_position -- This is a 16-bit integer which establishes the initial value for both the
DESIRED_POSITION and the CURRENT_POSITION. This is efficient since both values need to
be set to the same value when the TSM function is initialized.
table_size_index -- This parameter combines the table size and the table index values into a single
16-bit input. The eight bits for the table size is the number of bytes used in the parameter table
encoded into a hex ($) value. The table index is set in the last 8-bits of this parameter and must be
set to the value of zero.
slew_period -- This parameter combines the slew period with the 1-bit "S" value. The slew period
value must be shifted left by one bit after encoding into a hex value. e.g. an original value of $2000
will be encoded as $4000.The least significant bit (bit #15, Big Endian) is the "S" bit and must
always be written to zero (and only at initialization).
start_period -- This parameter combines the start period with the 1-bit "A" value. The start period
value must be shifted left by one bit after encoding into a hex value. e.g. an original value of $6800
will be encoded as $D000. The least significant bit (bit #15, big endian) is the "A" bit. A value of 0
will initialize a two channel TSM function and a value of 1 will initialize a four channel function.
This value must not be changed after initialization.
pin_sequence -- This parameter determines the step patterns that are output on two or four TPU
pins. Two channel and four channel example values are $3333 and $E0E0 respectively.
number_channels -- This parameter is used with the master channel designation to determine
which channels will be the parameter table channels for the TSM function. Either a two or four
channel designation is valid. The master channel is included in this number.
*table -- This is the pointer to the first parameter table channel. This is used to load the parameter
table for the TSM from memory into the TPU RAM.
table_size -- This parameter provides a byte count limit when loading the parameter table.
*tpu -- This is the pointer to the TPU module chosen to run the TSM function. It is a structure of
type (name) TPU3_tag which is defined in m_tpu3.h.
channel -- This is the channel number of the primary TSM master channel.
position -- This parameter is the value of the new DESIRED_POSITION.
void tpu_tsm_mov
Freescale Semiconductor, Inc.
Using the Table Stepper Motor TPU Function
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA

Related parts for AN2364