R01UH0136EJ0210 Rev.2.10
Page 344 of 800
Jul 31, 2012
M16C/64A Group
19. Three-Phase Motor Control Timer Function
19.3.1.7
Three-Phase PWM Output Pin Select
Pins U,
U
, V,
V
, W, and
W
output a three-phase PWM waveform when the PFCi bit (i = 0 to 5) in the
PFCR register is 1 (three-phase PWM output). When the PFCi bit is 0 (I/O port), these pins are used
as I/O ports (or other peripheral function I/O ports). Therefore, while some of the six pins output a
three-phase PWM waveform, the other pins can be used as I/O ports (or other peripheral function I/O
ports).
The PFCR register can be rewritten when the TPRC0 bit in the TPRC register is 1 (write to the PFCR
register enabled). The functions of the three-phase PWM waveform output pins can be protected
from being rewritten due to an unexpected program operation. To prevent rewrite, follow these steps:
(1) Set the TPRC0 bit to 1.
(2) Rewrite the PFCR register.
(3) Set the TPRC0 bit to 0 (write to the PFCR register disabled).
Figure 19.4 shows Three-Phase Output and I/O Port Switch Function Operation.
Figure 19.4
Three-Phase Output and I/O Port Switch Function Operation
Timer B2
U-pin output
V-pin output
W-pin output
Functions as a port
Functions as a port
Write to the PFCR register
PFC0 bit = 1
PFC2 bit = 1
PFC4 bit = 0
Write to the PFCR register
PFC0 bit = 1
PFC2 bit = 0
PFC4 bit = 1
The above assumes the following:
y
The output data of the ports which share a pin with pins V and W are both 0 (low-level).
y
The direction bits of the ports which share a pin with pins V and W are both 1 (output mode).
Содержание M16C/60 Series
Страница 853: ...M16C 64A Group R01UH0136EJ0210...