
ML66517 Family User’s Manual
Chapter 10
3-Phase PWM Function
10 – 17
10.3.2 Example 3-Phase PWM Register Settings
10.3.2.1 3-Phase PWM Cycle Settings
Formulas for computing the 3-phase PWM cycle are listed below.
[For the up-counter mode]
f(up) = PW3CLK/(PW3CYR + 1)
[For the up-down-counter mode]
f(updown) = PW3CLK/(2
× PW3CYR + 1)
f(up), f(updown)
: 3-phase PWM cycle (Hz)
PW3CLK
: 3-phase PWM input clock frequency (Hz)
PW3CYR
: PW3CYR value
(If PW3CYR = 0, PW3C is halted at 0000H)
10.3.2.2 Dead Time Setting
The formula for computing the dead time is listed below.
t(DTM) = (1/DTMCLK)
× (DTMR + 1)
t(DTM)
: dead time (seconds)
DTMCLK
: dead time timer input clock frequency (Hz)
DTMR
: DTMR value (8 bits)
10.3.2.3 Mode 1 Setting Example 1
This mode generates 3-phase AC motor driving waveforms. Non-overlapping PWM waveform output can be
obtained with the dead time timer and positive phase (PWMU, PWMV, PWMW) and reverse phase (PWMUB,
PWMVB, PWMWB) outputs.
The example setting listed below configures PW3C as an up-down-counter, specifies PW3nR (n = U, V, W) to
be loaded when underflow of PW3C occurs (once per PWM cycle), and sets the active level as “l(fā)ow-level”.
An operating example is described in section 10.4.2.1.
(1) External Interrupt Control Register 1 (EXI1CON)
If 3-phase PWM is to be used, write 55H to EXI1CON.
(2) Port 16 Mode Register (P16IO)
Set bits 0 though 5 (P16IO0 to P16IO5) to “1” to configure each 3-phase PWM output pin (PWMU,
PWMUB, PWMV, PWMVB, PWMW, PWMWB) as an output.
If
INACT is to be used, reset bit 6 (P16IO6) to “0” to configure the port as an input.
(3) Port 16 Secondary Function Control Register (P16SF)
Set bits 0 though 5 (P16SF0 to P16SF5) to “1” to configure each 3-phase PWM output pin (PWMU,
PWMUB, PWMV, PWMVB, PWMW, PWMWB) as a secondary function output.
If
INACT is to be used, specify with bit 6 (P16SF6) whether the INACT input will be pulled-up.
(4) 3-Phase PWM Cycle Buffer Register (PW3CYBFR)
Set the PWM cycle.
While the 3-phase PWM counter is halted, writing to PW3CYBFR causes the same value to be
simultaneously and automatically written to the 3-phase PWM cycle register (PW3CYR).
(5) Duty Setting Buffer Registers (PW3nBFR: n = U, V, W)
Set the duty value for each phase.
While the 3-phase PWM counter is halted, writing to PW3nBFR causes the same value to be
simultaneously and automatically written to the duty setting registers (PW3nR: n = U, V, W).
(6) Dead Time Timer Register (DTMR)
Set the value to be loaded into the dead time timer when the dead time timer is activated.