AN2364 Freescale Semiconductor / Motorola, AN2364 Datasheet - Page 30

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
tpu_tsm.c
}
/****************************************************/
/*
/****************************************************/
/**************************************************/
/* Generate other tasks for the TSM function.
/**************************************************/
/*******************************************************************************
FUNCTION
PURPOSE
INPUTS NOTES
GENERAL NOTES : The channel must be a master channel for the TSM function. There
*******************************************************************************/
void tpu_tsm_mov(struct TPU3_tag *tpu, UINT8 channel, UINT16 position)
/* write a new desired position into the TSM master channel */
30
/* End tpu_tsm_init */
tpu_hsr(tpu, param2_channel, TPU_TSM_INIT_LO);
if(number_channels > 3) {
tpu_hsr(tpu, param3_channel, TPU_TSM_INIT_LO);
/* Enable channels by assigning a priority to them. */
/* All Channels MUST have the same priority.
tpu_enable(tpu, master_channel, priority);
tpu_enable(tpu, param1_channel, priority);
tpu_enable(tpu, param2_channel, priority);
tpu_enable(tpu, param3_channel, priority);
{
tpu->PARM.R[channel][TPU_TSM_DESIRED_POSITION] = position;
}
}
End of TPU Initialization
: tpu_tsm_mov
: To activate the move and acceleration of the stepper motor.
: This function has 3 parameters:
*tpu - This is a pointer to the TPU3 module to use. It is of
channel - This is the number of the master channel
position - The new desired position for the stepper motor.
can be more than one master channel in the same TPU. The
additional master channel(s) would be for another TSM function.
type TPU3_tag which is defined in m_tpu3.h
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