Pages: [1]   Go Down
Author Topic: A question about PWM and Timers  (Read 670 times)
0 Members and 1 Guest are viewing this topic.
Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Melbourne
Offline Offline
Jr. Member
**
Karma: 2
Posts: 83
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


0
Offline Offline
Sr. Member
****
Karma: 2
Posts: 360
I'm 15. I like making things. I like breaking things better.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

Brazil
Offline Offline
God Member
*****
Karma: 3
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Wk
Logged


Pages: [1]   Go Up
Jump to: