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?