A question about PWM and Timers

Guys, could someone give me some hints, please? I’m trying to use the following code:


But I wish to use that for 6 PWM outputs. To be honest I don’t know if its possible to have 6 different separated PWM values going on with FAST PWM. Is that possible?

How would I change the code so I can have 6 pwm timers running?

Thanks for any advice.

My understanding is that on a standard Arduino there is only 3 timers that you can use and timer0 is used to deal with delay() / millis() etc so you probably don't want to mess with that. I think the mega has more (not sure how many more off the top of my head) but I reckon that would be your best bet for doing something like this.

Cheers ajfisher

Dude, thanks, but that's old news, I already major on pwm and timers, thanks to the reading of the pdf files. ;-) :fearful:

For our Beat707 project we used the Timer1 which is 16 bits and the Arduino doesn't use it. (only the Tone library uses it)


It looks to me like you'd need another 62500hz timer for each pin you want to PWM...so your 6 just isnt going to happen.

Humm, bad news again, I already did that and posted a few weeks ago a 6 voices code with separated pwm outputs. ;-)