AN2364 Freescale Semiconductor / Motorola, AN2364 Datasheet - Page 38

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
void tpu_tsm_int_lev(struct TPU3_tag *tpu, UINT8 level);
int tpu_tsm_int_chk(struct TPU3_tag *tpu, UINT16 channel);
void tpu_tsm_cisr_clr(struct TPU3_tag *tpu, UINT16 CISR_level);
#ifdef
}
#endif
10.3 tpu_tsm_ex1.c
The developer should use this code as an example for calling the TPU TSM functions and incorporating
these calls into a final application.
/**************************************************************************/
/* FILE NAME: tpu_tsm_ex1.c
/* VERSION: 1.0
/*
/* DESCRIPTION: This sample program shows a simple example of a program
/* that initializes the TSM function and updates a desired position
/* varible from the CPU. The position in the current position moves most
/* efficiently to the new desired position. The table of byte variables
/* establishes the rate of speed. Advancing through the next byte step in */
/* the table will accelerate the speed of the motor. (ie. Table Stepper
/* Motor--TSM).
/* The example uses the TPU A on a master channel and up to three
/* consecutive channels. The master channel for this example is 0. With
/* channels 1, 2, and 3 as the table parameter channels.
/* The program is targeted for the MPC555 but should work on any MPC500
/* device with a TPU. For other devices the setup routines will also need */
/* to be changed.
/*========================================================================*/
/* HISTORY
/* REV
/* ---
/* 1.0
/* 1.1
/**************************************************************************/
#include "mpc565.h"
38
__cplusplus
-----------
J. Loeliger
G. Jackson
AUTHOR
ORIGINAL AUTHOR: Jeff Loeliger
---------
03/Aug/02
12/Aug/02
DATE
/* Define all of the MPC555 registers, this needs to */
/* changed if other MPC500 devices are used.
Freescale Semiconductor, Inc.
Using the Table Stepper Motor TPU Function
For More Information On This Product,
DESCRIPTION OF CHANGE
---------------------
Initial version of function.
Convert to TSM example.
Go to: www.freescale.com
COPYRIGHT (c) MOTOROLA 2002 */
All Rights Reserved
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
MOTOROLA

Related parts for AN2364