AN2364 Freescale Semiconductor / Motorola, AN2364 Datasheet - Page 14

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
TSM Function Parameters Address Maps
6
The CPU configures the TSM function as follows. For configuration of the overall operation of the TPU
module, such as prescaler selection etc., refer to the TPU reference manual (TPURM/AD). These are the
steps necessary to initialize and then run a TSM function with the channels of the TPU:
After each channel has been initialized, the TPU clears the host service request bits and asserts an interrupt
request from that channel. If the channel interrupt enable bit is set then a CPU interrupt will result.
When all host service request bits have been cleared by the TPU and/or an interrupt request has been
generated from all the TSM channels, the CPU can assume that the motor is correctly initialized.
Once initialization is complete, the CPU controls the TSM function through the master channel only. The
CPU can now issue a move request to the TSM function in the following manner:
14
1. The appropriate channel priority bits are cleared, disabling the master and slave TSM channels.
2. The TSM function number is written to the channel function select bits of both the master channel
3. The interrupt control registers are initialized if the function is to be interrupt driven.
4. An acceleration table is written by the CPU into TPU parameter RAM.
5. DESIRED_POSITION and CURRENT_POSITION are both initialized to the same value.
6. TABLE_SIZE is written to reflect acceleration table size and TABLE_INDEX is written to $00.
7. SLEW_PERIOD, START_PERIOD, BIT_S, and BIT_A are written with SLEW_PERIOD <
8. PIN_SEQUENCE is written with a value that will determine the channel pin responses as the
9. The host sequence bits, HSQ[1:0] of the master channel are written to select the operating mode.
10. An HSR %01 or %10 is issued to each TSM channel to initialize the function and set the channel
11. The channel priority bits are written to enable the function and assign channel priority.
12. The TPU executes the selected initialization states.
1. Writing the required motor position to DESIRED_POSITION.
2. Issuing a Move Request host service request to the master channel (HSR = %11).
and slave channels.
START_PERIOD and BIT_A determining two or four channel operation. BIT_S should be cleared
and never written too again.
motor steps. Bit14 or 0 of PIN_SEQUENCE determines the pin state of the master channel after
the first step match depending on the direction of the first step.
pin to the desired initial output state. The HSR issued to the master channel should match the MSB
of PIN_SEQUENCE and the HSR issued to the slaves should match their corresponding bit in
PIN_SEQUENCE.
Configuration of TSM Function
Example 1: four-channel mode with two rotates of PIN_SEQUENCE between channels:
Example 2: two-channel mode with one rotate of PIN_SEQUENCE between channels:
If PIN_SEQUENCE = $E0E0, then the following HSRs should be issued
Master HSR %10 (pin high)
Slave1 HSR %01 (pin low)
Slave2 HSR %01 (pin low)
Slave3 HSR %10 (pin high)
If PIN_SEQUENCE = $9999, then the following HSRs should be issued
Master HSR %10 (pin high)
Slave1 HSR %10 (pin high)
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