Go Down

Topic: A question about PWM and Timers (Read 977 times) previous topic - next topic

WilliamK Govinda

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.


WilliamK Govinda

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

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.
Alice asked the Chesire Cat, who was sitting in a tree, "What road do I take?"
The cat asked, "Where do you want to go?"
"I don't know," Ali

WilliamK Govinda

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


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131