Go Down

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

WilliamK Govinda

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

http://www.arduino.cc/playground/Code/PCMAudio

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.

ajfisher

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


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)

Wk

bilbo

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. ;-)

Wk

Go Up