This is an simple XMC4500 Barebone PWM Example which use the CCU4 in Edge Aligned Mode
The PWM duty cycle can change over the Compare Value.
=> DC = 1 - Compare-Value / (Period-Value +1)
The PWM Frequency can change over the Period Value.
=> T = Period-Value + 1
The following example show a pwm with a duty-cycle from 20% and a pwm Frequency from 1kHz.
Calculating the Period-Value:
Period-Value = (10E-3/16,666ns) - 1
Calculating the Compare-Value:
Compare-value = Period-value - (Period-value * 0,20)
The following picture shows the Output on P1.3
