Hello,
I am generating two PWM signals with Arduino UNO. They have different duty cycles.
I want them start with same point. Since they are center aligned they are not starting from same where.
Is it possible to left align the signals.
Thank you
Hello,
I am generating two PWM signals with Arduino UNO. They have different duty cycles.
I want them start with same point. Since they are center aligned they are not starting from same where.
Is it possible to left align the signals.
Thank you
Are you not using analogWrite()? I thought analogWrite() uses Fast PWM.
I think just have to pick two PWM pins that use the same timer. On the UNO or other ATmega328p-based Arduino that would be:
3 and 11 (Timer 2)
5 and 6 (Timer 0)
9 and 10 (Timer 1)
Thank you for your response.
Yes, I am using analogWrite() and also I am using pins 9 and 10.
They are using the same timer. When I change both same duty cycle they are identical.
but when I change them to dffrent duty cyle with same period. they dont start from same point. They start from center of the duty cycle.
Pins 9 and 10 are outputs for Timer 1. The default mode of timer 1(and Timer 2 pins 3,11) is Phase correct, 8 bit, PWM which will center the pulse.
Try your output on pins 5 and 6 on Timer 0 which is the only timer with a default to Fast PWM. Frequency will be 980 Hz.
Thank you cattledog,
Pins 5 and 6 worked.