15.4.3.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, a 100% duty cycle pulse is produced. If PGxPHASE + PGxDC > PGxPER, the falling edge is terminated at the EOC. Figure 15-5 shows the relationship between the control SFRs and the output waveform.

Figure 15-5. Independent Edge PWM Mode