Enhanced PWM Steering Mode

Last modified by Microchip on 2023/11/09 09:02

When the Enhanced Pulse-Width Modulation (PWM) is enabled in a single output mode, the PxA I/O pin will drive the pulse width modulated signal. However, that can be directed to other PWM I/O pins through the Steering Mode option.

PWM steering allows any of the PWM pins to be set as the modulated signal. Additionally, the same PWM signal can be simultaneously available on multiple PWM pins. The PWM auto-shutdown option works on all the enabled PWM I/O pins.

Pulse-Width Modulation diagram

Single Output Mode

The Single Output mode is selected by the PxM<1:0> bits in the CCPxCON register. The module has to also be in the EPWM mode which is any of the Enhanced PWM mode selections in the CCPxCON register.

CCPxCON: CCPx Control Register

R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0
PxM1PxM0DCxB1DCxB0CCPxM3CCPxM2CCPxM1CCPxM0
bit 7      bit 0

bit 7-6

PxM<1:0>: Enhanced PWM Output Configuration Bits

00 = Single output; PxA modulated; PxB, PxC, PxD assigned as port pins
01 = Full-Bridge output forward; PxD modulated; PxA active; PxB, PxC inactive
10 = Half-Bridge output; PxA, PxB modulated with dead-band control; PxC, PxD assigned as port pins
11 = Full-Bridge output reverse; PxB modulated; PxC active; PxA, PxD inactive

bit 3-0

CCPxM<3:0>: ECCP Mode Select bits

1100 = PWM mode: PxA, PxC active-high; PxB, PxD active-high
1101 = PWM mode: PxA, PxC active-high; PxB, PxD active-low
1110 = PWM mode: PxA, PxC active-low; PxB, PxD active-high
1111 = PWM mode: PxA, PxC active-low; PxB, PxD active-low

Back to Top

Steering Mode Setting

Routing a PWM signal to a different I/O pin, or more than one I/O pin, can be accomplished with the PWM Steering option. By setting the associated bit for each PWM I/O pin in the PSTRxCON register, the PWM output can be directed to the specific I/O pin.

PSTRxCON: PWM Steering Control Register

U-0U-0U-0R/W-0R/W-0R/W-0R/W-0R/W-0
STRxSYNCSTRxDSTRxCSTRxBSTRxA
bit 7      bit 0

bit 3

STRxD: Steering Enable bit D

1 = PxD pin has the PWM waveform with polarity control from CCPxM<1:0>
0 = PxD pin is assigned to port pin

bit 2

STRxC: Steering Enable bit C

1 = PxC pin has the PWM waveform with polarity control from CCPxM<1:0>
0 = PxC pin is assigned to port pin

bit 1

STRxB: Steering Enable bit B

1 = PxB pin has the PWM waveform with polarity control from CCPxM<1:0>
0 = PxB pin is assigned to port pin

bit 0

STRxA: Steering Enable bit A

1 = PxA pin has the PWM waveform with polarity control from CCPxM<1:0>
0 = PxA pin is assigned to port pin

Back to Top

Steering Synchronization

The Enhanced PWM Steering can control when the PWM signal will update via the Synchronization settings.

The STRxSYNC bit of the PSTRxCON register provides the user with two options for when the steering event will occur.

When the STRxSYNC bit is 0, the steering event will happen at the end of the instruction that writes to the PSTRxCON register. In this case, the output signal at the Px<D:A> pins may be an incomplete PWM waveform. This operation is useful when the user firmware needs to immediately remove a PWM signal from the pin.

When the STRxSYNC bit is 1, the effective steering update will happen at the beginning of the next PWM period. In this case steering ON/OFF of the PWM output will always produce a complete PWM waveform.

PSTRxCON: PWM Steering Control Register

U-0U-0U-0R/W-0R/W-0R/W-0R/W-0R/W-0
STRxSYNCSTRxDSTRxCSTRxBSTRxA
bit 7      bit 0

bit 4

STRxSYNC: Steering Sync bit

1 = Output steering update occurs on next PWM period
0 = Output steering update occurs at the beginning of the instruction cycle boundary

Back to Top