AN2364 Freescale Semiconductor / Motorola, AN2364 Datasheet - Page 19

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
Generating Step Patterns
8.2
The TSM function has been designed to provide as much flexibility as possible in the generation of the step
patterns that drive the motor. Any value can be written into the PIN_SEQUENCE parameter and the choice
of one or two rotates of PIN_SEQUENCE between channels increases the flexibility further. This flexibility
may allow the TSM function to meet the needs of an unusual drive scheme. However, since the primary
purpose of the TSM function is to drive stepper motors in a conventional manner, it has been tested using
the two stepping schemes described below:
In full step two-channel mode (see Figure 6) the PIN_SEQUENCE parameter should be initialized to $3333
or a shifted version of this value such as $6666 or $9999. Master channel host sequence bit 1 should be
cleared to select one rotate of PIN_SEQUENCE between channels. The initial value of PIN_SEQUENCE
written to parameter RAM defines the starting point of the step sequence.
To generate a step, the PIN_SEQUENCE is rotated left or right once, depending on the motor direction. The
master channel pin level at the end of the step (i.e. when the next match occurs) is defined by the MSB of
the rotated PIN_SEQUENCE. The new PIN_SEQUENCE value is stored in parameter RAM. The pin level
of the slave channel is obtained by further rotating a copy of the new PIN_SEQUENCE right once. The
value of the resulting MSB determines the slave pin level. Figure 6 shows the effective positions of the bits
that determine the pin levels of the master and slave channels.
During initialization, an HSR request is issued to each TSM channel to configure the initial pin level. The
HSR type issued to each channel should match the value of the corresponding channel bit in the initial
PIN_SEQUENCE. For example, if $3333 is written to PIN_SEQUENCE, then an HSR%01 should be
issued to the master channel (pin low) and an HSR%10 to the slave channel (pin high).
19
Generating Step Patterns
S1 -- TSM_INIT_LO
S2 -- TSM_INIT_HI
S3 -- TSM_MOVE_REQ
S4 -- TSM_STEP_MATCH
State Number and Name
2 channel mode
4 channel mode
Already stepping
2 channel mode
4 channel mode
Table 3. Table Stepper Motor Function—State Timing
Freescale Semiconductor, Inc.
Using the Table Stepper Motor TPU Function
For More Information On This Product,
Go to: www.freescale.com
Max. CPU Clock Cycles
162
210
172
220
6
6
6
RAM Accesses by TPU
17
17
20
20
1
MOTOROLA

Related parts for AN2364