When the Enhanced PWM is configured for Full-Bridge mode, four I/O pins are used as PWM outputs. This allows both forward and reverse control of the current through the load, typically a motor.
The PxA, PxB, PxC and PxD I/O pins will be driven as outputs and are multiplexed with digital I/O pins. Therefore, the associated TRIS bits must be cleared to configure the PxA, PxB, PxC and PxD pins as outputs.
DIRECTION CHANGE
The PxM1 bit in the CCPxCON register controls the forward/reverse direction. When the application firmware changes this direction control bit, the module will change to the new direction on the next PWM cycle.
In the Forward direction mode, the pin PxA is driven to its active state, and the pin PxD is modulated, while PxB and PxC will be driven to their inactive state.
In the Reverse direction mode, PxC is driven to its active state and the pin PxB is modulated, while PxA and PxD will be driven to their inactive state.
When changing direction, the following sequence occurs four Timer2 cycles prior to the end of the current PWM period:
- The modulated outputs (PxB and PxD) are placed in their inactive state.
- The associated unmodulated outputs (PxA and PxC) are switched to drive in the opposite direction.
- PWM modulation resumes at the beginning of the next period.
DEAD-BAND DELAY
The Full-Bridge mode on the Enhanced PWM does not provide dead-band delay. Since only one output is modulated at a time, dead-band delay is generally not required. There are rare situations where dead-band delay is required. This situation occurs when both of the following conditions are true:
1. The direction of the PWM output changes when the duty cycle of the output is at or near 100%.
2. The turn-off time of the power switch, including the power device and driver circuit, is greater than the turn-on time.
In the 100% duty cycle waveforms below, at time t1, the output PxA and PxD become inactive, while at the same time output PxC becomes active. This can cause a short period of shoot-through current.
Two possible solutions for eliminating the shoot-through current are:
1. Reduce PWM duty cycle for one PWM period before changing directions.
2. Use switch drivers that can drive the switches off faster than they can drive them on.