AN2364 Freescale Semiconductor / Motorola, AN2364 Datasheet - Page 40

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
/* Enable interrupts; set the interrupt level in the TPU CIER
/**************************************************/
/*
/**************************************************/
/* Designate which tpu (A), the master channel = mas_channel,
/*
/* NOTE: The Master Channel cannot change from the init designation! */
/**************************************************/
/* Make changes after an interrupt.
/**************************************************/
/* Do other productive work while waiting for move to complete */
40
tpu_tsm_init(tpua, mas_channel, TPU_PRIORITY_HIGH, start_position,
while (!flag ) { /* Interrupt routine will set this flag */
/* Initialize Table Stepper Motor function with:
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
dp_val = 0x3000;
tpu_tsm_int_config(tpua, mas_channel, int_level);
Generate a new desired position.
tpu_tsm_mov(tpua, mas_channel, dp_val);
x=8;
and the new desired location value (0x3000)
-Input signal on TPU A,
-master_channel = mas_channel
-Schedule as high priority in the TPU
-Initial desired position of 0x0010,
-Initial current position of 0x0010,
-Table Size of 0x18 (d24), Table Index of 0x00,
-Slew Period of 0x2000 (shift to 0x4000),
-Start Period of 0x6800 (shift to 0xD000), A = 1,
-Pin Sequence of 0xE0E0.
-Number of channels = 4.
-*table -- start address of parameter table.
-load_table_size -- number of table bytes to load. */
table_siz_index, 0x4000, 0xD001, 0xE0E0, num_channel,
table, table_size);
Freescale Semiconductor, Inc.
Using the Table Stepper Motor TPU Function
For More Information On This Product,
Go to: www.freescale.com
*/
*/
S = 0,
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
MOTOROLA

Related parts for AN2364