802
Chapter 21
Stepper Motor Controller/Driver (Stepper-C/D)
Preliminary User’s Manual U17566EE1V2UM00
(5)
MCMPCnk - Compare control registers (k = 1 to 6)
The 8-bit MCMPCnk registers control the operation of the corresponding
compare registers and the output direction of the PWM pin.
Access
These registers can be read/written in 8-bit units.
Address
<base> + A
H
, C
H
, E
H
, 10
H
, 1A
H
, 1C
H
Initial Value
00
H
. This register is cleared by any reset.
7
6
5
4
3
2
1
0
AOUT
0
a
a)
Do not change this bit.
0
b
b)
This bit may be written, but writing is ignored.
TEN
ADB1
ADB0
DIR1
DIR0
R/W
R/W
R
R/W
R/W
R/W
R/W
R/W
Table 21-4
MCMPCnk register contents
Bit position
Bit name
Function
7
AOUT
Selects the output pins for sine and cosine signals
0: The PWM signals for sine and cosine side are output to those pins that are
selected by bits DIR0 and DIR1. At all other pins, the output signal is 0 (SMV
SS
level).
1: The PWM signal for the sine side is output to pins SMk1 and SMk2. The PWM
signal for the cosine side is output to pins SMk3 and SMk4.
4
TEN
Transfer enable control bit
0: MCMPnk0/MCMPnk1 master-to-slave register copy is disabled. New data can
be written to compare registers MCMPnk0 or MCMPnk1.
1: MCMPnk0/MCMPnk1 master-to-slave register copy is enabled. The copy
process will take place when CNT0 or CNT1, respectively, overflows. Don't
write to compare registers MCMPnk0 or MCMPnk1 while MCMPCnk.TEN = 1.
Note:
This bit functions as a control bit and status flag. It is automatically reset to
zero upon the next timer counter overflow.
3
ADB1
Sets 1-bit addition function for cosine side
0: no 1-bit addition to PWM signal
1: 1-bit addition to PWM signal
2
ADB0
Sets 1-bit addition function for sine side
0: no 1-bit addition to PWM signal
1: 1-bit addition to PWM signal
1 to 0
DIR[1:0]
Selects the output pins for the PWM signals.
Bits DIR1 and DIR0 address the quadrant to be activated by sine and cosine. The
PWM signal is routed to the specific pin with respect to the sin/cos of each
quadrant.
DIR1
DIR0
Selected output pins
0
0
Quadrant 1: SMk1 (sin +), SMk3 (cos +)
0
1
Quadrant 2: SMk1 (sin +), SMk4 (cos –)
1
0
Quadrant 3: SMk2 (sin –), SMk4 (cos –)
1
1
Quadrant 4: SMk2 (sin –), SMk3 (cos +)
At the other output pins, the output level is SMV
SS
.
Note:
These bits are only considered if bit AOUT is set to 0.
electronic components distributor