Complementary PWM on the Due

Good day,

I've tried the code given on this forum post to generate complementary PWM signals:

But when I change the period and duty cycle the circuit behaves unexpectedly. When I have the duty cycle set to 100% the PWML2 pin outputs a high abd when I have the duty cycle at 0% the PWMH2 pin outputs a high. Also for even number duty cycles such as 100%, 80%, 60%..... the PWML2 outluts high while for 90, 70, 50...... The two pins output values. can someone clarify got me how this code is supposed to work?

Where is your code ?

In some PWM the PWM_CDTY is the off time the H and L shows you that, H duty equals off time, L duty equal on time.

I tested the PWMH2, if you put a LED over it as high the duty goes the LED gets darker.

I also tested the PWML6 and PWML7 and the behavior is the expected as high is the duty goes more bright the led gets.

Here post #4 how to enable 8 PWM channels for testing

Thank you