
ML66517 Family User’s Manual
Chapter 10
3-Phase PWM Function
10 – 19
10.3.2.5 Mode 2 Setting Example
This mode generates 3-phase brushless DC motor driving waveforms. PWM output or level output can be
selected for each output pin. Output pattern switching can be implemented by the compare-match signal from the
compare out module of the capture/compare timer, or by the software. The dead time timer does not operate.
The example setting listed below configures PW3C as an up-counter and sets the active level as “l(fā)ow-level”.
An operating example is described in section 10.4.2.3.
(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) 3-Phase Output State Setting Buffer Register (OTST3BFR)
To set the 3-phase PWM output pins (PWMU, PWMUB, PWMV, PWMVB, PWMW, and PWMWB) as
PWM outputs, reset the corresponding bits to “0”. To set as level outputs, set the corresponding bits to “1”.
While the 3-phase PWM counter is halted, writing to OTST3BFR causes the same value to be
simultaneously and automatically written to the 3-phase output state setting register (OTST3R).
(7) 3-Phase Output Data Setting Buffer Register (OUT3BFR)
If the 3-phase PWM output pins (PWMU, PWMUB, PWMV, PWMVB, PWMW, and PWMWB) are
configured as level outputs, reset the corresponding bits to “0” to specify low-level output, or set the
corresponding bits to “1” to specify high-level output.
While the 3-phase PWM counter is halted, writing to OUT3BFR causes the same value to be
simultaneously and automatically written to the 3-phase output data setting register (OUT3R).
(8) 3-Phase PWM Interrupt Control Register (PW3INT)
With bit 3 (PC3CMIE), enable or disable interrupt requests generated when the 3-phase PWM counter
(PW3C) matches the 3-phase PWM cycle register (PW3CYR).
(9) 3-Phase Output Active Level Setting Register (ACL3R)
Reset to “0” the bits corresponding to each 3-phase output pin (PWMU, PWMUB, PWMV, PWMVB,
PWMW, and PWMWB) to specify “l(fā)ow active”.