ADuCM320 Hardware Reference Manual
UG-498
Rev. C | Page 179 of 196
H-Bridge Mode
In H-bridge mode, the period and duty cycle of the four outputs are controlled using the Pair 0 registers: PWM0COM0, PWM0COM1,
PWM0COM2, and PWM0LEN. In addition, the state of the output is controlled by PWMCON0 Bit 9, Bit 5, Bit 4, and Bit 2, as summarized
in Table 267.
An example of H-bridge configuration is shown in Figure 34. Note that only PWM0 to PWM3 participate in H-bridge mode; other outputs
(PWM4 to PWM7) do not and continue to generate standard mode output.
M
PWM0
P CHANNEL
N CHANNEL
G
S
D
PWM1
PWM2
PWM3
+
–
1
1
176-
135
Figure 34. Example H-Bridge Configuration
Table 267. PWM Output in H-Bridge Mode
PWM Control Bits
PWM Outputs
1
ENA
PWMCON0[9]
POINV
PWMCON0[5]
HOFF
PWMCON0[4]
DIR
PWMCON0[2]
PWM0
PWM1
PWM2
PWM3
State of Motor
0
X
0
X
1 (Disable)
1 (Enable)
1 (Disable)
1 (Enable)
Brake
X
X
1
X
1 (Disable)
0 (Disable)
1 (Disable)
0 (Disable)
Free run
1 0 0 0 0
(Enable)
0
(Disable)
HS
LS
Move controlled
by LS on PWM3
1 0 0 1 HS
LS
0
(Enable)
0
(Disable)
Move controlled
by LS on PWM1
1 1 0 0 LS HS
1 (Disable)
1 (Enable)
Move controlled
by LS on PWM0
1 1 0 1 1
(Disable)
1
(Enable)
LS HS Move
controlled
by LS on PWM2
1
HS = high side, LS = low side, HS = inverse of high side, LS = inverse of low side, as programmed in PWM0 registers.
PWM INTERRUPT GENERATION
PWM Trip Function Interrupt
When the PWM trip function is enabled (TRIPEN, PWMCON1[6]) and the PWM trip input signal goes low (falling edge), the PWM
peripheral disables itself (PWMCON0[0] = 0). It also generates the PWM trip interrupt. The interrupt is cleared by setting PWMCLRI[4].
When using the PWM trip interrupt, clear the PWM interrupt before exiting the ISR. This prevents the generation of multiple interrupts.
PWM Output Pairs Interrupts
In standard mode, each PWM pair has a dedicated interrupt: IRQPWM0, IRQPWM1, IRQPWM2, IRQPWM3.
When the interrupt generation is enabled (PWMCON0[10]) and the counter value for Pair 0 changes from PWM0LEN to 0, it also
generates the IRQPWM0 interrupt. The interrupt is cleared by setting PWMCLRI[0].
When the interrupt generation is enabled (PWMCON0[10]) and the counter value for Pair 1 changes from PWM1LEN to 0, it also
generates the IRQPWM1 interrupt. The interrupt is cleared by setting PWMCLRI[1].
When the interrupt generation is enabled (PWMCON0[10]) and the counter value for Pair 2 changes from PWM2LEN to 0, it also
generates the IRQPWM2 interrupt. The interrupt is cleared by setting PWMCLRI[2].
When the interrupt generation is enabled (PWMCON0[10]) and the counter value for Pair 3 changes from PWM3LEN to 0, it also
generates the IRQPWM3 interrupt. The interrupt is cleared by setting PWMCLRI[3].
In H-bridge mode, Pair 0 and Pair 1 are used in the bridge configuration and generate on interrupt only, IRQPWM0. While Pair 0 and
Pair 1 are in H-bridge mode, Pair 2 and Pair 3 can be used in standard mode and they can generate the IRQPWM2 and IRQPWM3 interrupts.