AN2364 Freescale Semiconductor / Motorola, AN2364 Datasheet - Page 32

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 Interrupt tasks for the TSM interrupt. */
/***************************************************/
/*******************************************************************************
FUNCTION
PURPOSE
INPUTS NOTES
GENERAL NOTES : Level must be in the range of 0 to 31.
*******************************************************************************/
void tpu_tsm_int_lev(struct TPU3_tag *tpu, UINT8 level)
/*******************************************************************************
FUNCTION
PURPOSE
INPUTS NOTES
32
{
};
int remainder;
if( level > 23) {
else if( level > 15) {
else if( level > 7) {
else {
}
}
}
}
tpu->TICR.B.ILBS = 0x11;
remainder = level - 24;
tpu->TICR.B.CIRL = remainder;
tpu->TICR.B.ILBS = 0x10;
remainder = level - 16;
tpu->TICR.B.CIRL = remainder;
tpu->TICR.B.ILBS = 0x01;
remainder = level - 8;
tpu->TICR.B.CIRL = remainder;
tpu->TICR.B.ILBS = 0x00;
tpu->TICR.B.CIRL = level;
: tpu_tsm_int_lev
: To program the level of interrupt from the TPU-TSM function.
: This function has 2 parameters:
: tpu_tsm_int_chk
: Interrupt check for TSM interrupt service request match.
: This function has 3 parameters:
*tpu - This is a pointer to the TPU3 module to use. It is of
level - The interrupt level (0 to 31).
*tpu - This is a pointer to the TPU3 module to use. It is of
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