SparkFun Forums 

Where electronics enthusiasts find answers.

Your source for all things Atmel.
By equipoise
Can I use analogWrite() PWM simultaneously on multiple pins without any timing problems? If there are timing issues, does their badness depend on the number of different PWM channels I use? The duty cycles on each pin will be different from each other. And if it's not possible to do this without timing badness, I'm interested in any suggestions about alternatives you might have.

I'm interested in learning about this behavior for both the Duemilanove (6 PWM channels) and the Mega (13 PWM channels).


-- equipoise
By Liencouer
I would guess (although I have not dug too deeply) that analog write sets up a timer with a constant frequency and then varies the duty cycle for each pin by comparing the desired value vs the count register. as such, i suspect you can use the analog writes as if they were independent of each other.