15.5.2.2.1 Independent Edge PWM Mode
Independent Edge PWM mode is used for many applications and can be
used to create edge-aligned PWM signals as well as PWM signals with arbitrary phase
offsets. This mode is the default operating mode of the PWM Generator and is selected when
MODSEL[2:0] = 000 (PGxCON[2:0]). Two Data registers
must be written to define the rising and falling edges. The characteristics of the PWM
signal are determined by these three SFRs:
- PGxPHASE: Determines the position of the PWM signal rising edge from the start of the timer count cycle.
- PGxDC: Determines the position of the PWM signal falling edge from the start of the timer count cycle.
- PGxPER: Determines the end of the PWM timer count cycle.
A basic Edge-Aligned PWM mode signal is created by setting PGxPHASE
= 0. Alternatively, multiple PWM Generators can
be synchronized to one another by using the same PGxPHASE value. A constant value
equivalent to the PGxPHASE value of other PWM Generators can be used to synchronize
multiple PGs. The duty cycle is varied by writing to the PGxDC register. Arbitrary phase
PWM signals may be generated by writing to PGxPHASE and PGxDC with the appropriate
values. If PGxPHASE = PGxDC, no PWM pulse will be produced. If PGxDC ≥ PGxPER, and
PGxPHASE = 0, a 100% duty cycle pulse is produced. If PGxDC ≥ PGxPER, and PGxPHASE ≠ 0,
the pulse will be terminated at EOC. Figure 15-5
shows the relationship between the control SFRs and the output waveform.
Multiple PWM Generators can be synchronized to make a multiphase system. There are multiple methods that can be used in different applications and PWM modes. SOC triggers can be shared across any PWM generator.
In this example, three PWM Generators are set to start and run synchronized:
- Configure all PWM Generators for application (ckl, PER, DC, etc).
- PG1 is self-triggered SOCS = 0b0000.
- PG2 SOCS trigger is PG1, SOCS = 0b0001.
- PG3 SOCS trigger is PG2, SOCS = 0b0010.
- PG2 and PG3 ON bits are set; cycles will not start until trigger from PWM1.
- PG1 ON bit is set; all PWM Generators start simultaneously.
In this example, a daisy-chain triggering scheme is used to synchronize and create an offset between each PWM Generator’s SOC:
- Configure all PWM Generators for application (ckl, PER, DC, etc).
- PG1 is self-triggered SOCS = 0b0000.
- PG1TRIGA is set to provide phase offset for PG1 to PG2.
- PG1 PTGRGSEL = 0001 to select TRIGA as trigger.
- PG2 SOCS trigger is PG1 , SOCS = 0b0001.
- PG2 TRIGA is set to provide phase offset for PG2 to PG3.
- PG2 PTGRGSEL = 0001 to select TRIGA as trigger.
- PG3 SOCS trigger is PG2, SOCS = 0b0010.
- PG2 and PG3 ON bits are set; cycles will not start until trigger from PWM1.
- PG1 ON bit is set.
