AN2364 Freescale Semiconductor / Motorola, AN2364 Datasheet - Page 41

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_ex1.c
/* Interrupt has occurred -- continue:
/*
/*
/* When return from interrupt, set a new desired location */
}
/*******************************************************************************
FUNCTION
PURPOSE
INPUTS NOTES
GENERAL NOTES : This routine is org'ed at 0x500. Only level 2 is shown as an
*******************************************************************************/
/* Below is a Diab Data centric routine. Other compilers */
/*
/*
41
while(1){
};
Below are examples of control logic used in a TSM function. */
Adapt this to your specific needs and controls.
may require a different structure for an external
interrupt service request.
dp_val = tpu_tsm_rd_dp(tpua, mas_channel);
cp_val = tpu_tsm_rd_cp(tpua, mas_channel);
if(dp_val = cp_val) { /* poll to see if current position has
};
/* Hold at end of program */
}
x=4;
if(cp_val > 2000) {
else {
}
dp_val -= 0x1000;
tpu_tsm_mov(tpua, mas_channel, dp_val);
/* End of main */
}
: Ext_Isr
: Interrupt call at interrupt request.
: This function has 0 parameters:
dp_val += 0x0500;
tpu_tsm_mov(tpua, mas_channel, dp_val);
*tpu - This is a pointer to the TPU3 module to use. It is of
level - The interrupt level (0 to 31).
example here.
type TPU3_tag which is defined in m_tpu3.h
Freescale Semiconductor, Inc.
Using the Table Stepper Motor TPU Function
/* reached desired position. Set new position. */
For More Information On This Product,
Go to: www.freescale.com
*/
*/
*/
*/
*/
MOTOROLA

Related parts for AN2364