337
Chapter 12 Interrupt Functions
12
Fig. 12-28 Data Transfer Control Timing
(4) Example of using automatic addition control and ring control
(a) Automatic addition control
The automatic addition control function adds the output timing data (t) specified by a macro service
pointer (MPT) to the contents of a compare register and writes the sum to the compare register.
Using this function makes it unnecessary for software to calculate the setting for the compare register
each time the compare register has to be set.
(b) Ring control
The ring control function cyclically outputs a pattern of predetermined output data.
When this function is used, only one cycle of output data pattern must be prepared even if more data
patterns are required. Therefore, the required data ROM area can be kept small.
The macro service counter (MSC) is decremented each time one data transfer is performed.
The ring control function also generates an interrupt request when MSC = 0.
Lets take an example of controlling a stepping motor. The data pattern output to the steeping motor
varies with the structure and excitation method (single-phase or double-phase excitation) of the motor.
In any case, the output pattern is repeated. Fig. 12-29 and 12-30 show examples of controlling a 4-phase
stepping motor with the phase 1 excitation method and the phases 1 and 2 excitation method,
respectively.
T1 T2 T3 T4 T5 T6 T7 T8 T9
D1 D2 D3 D4 D5 D6 D7 D8 D9
T8
T7
T5
T6
T4
T3
T2
T1
TM1 count value
0H
INTC10
timer interrupt
Compare register
(CR10)
Buffer register
POL
P00
P01
P02
P03