Arduino Mega Timers / PWM

Hey all,

I'm using an Arduino Mega board, and am incorporating the Tone.h library to play two tones simultaneously (see the "Ugly Details" section): http://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation

I've implemented the code on the Duemilanove without an issue, with timers 1 and 2 being "used up" as a consequence.

However, I was wondering which timers will be "used up" with the same code applied on the Arduino Mega, and which PWM pins will no longer be usable as a result.

I found this site to be somewhat helpful, but wasn't able to determine which timers will be used: http://softsolder.com/2010/09/05/arduino-mega-1280-pwm-to-timer-assignment/

Any help would be greatly appreciated. Thanks in advance!

TRTS

TonyStark:
Hey all,

Back at ya!

However, I was wondering which timers will be “used up” with the same code applied on the Arduino Mega

Use the Sorce, Luke…

http://code.google.com/p/rogue-code/source/browse/Arduino/libraries/Tone/trunk/Tone.cpp

const uint8_t PROGMEM tone_pin_to_timer_PGM[] = { 2, 3, 4, 5, 1, 0 };

Timers 2 and 3 will be used.

and which PWM pins will no longer be usable as a result

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1245229578

Ugh. Too many pins. You’ll have to find the ones effected. Search for “OC2” and “OC3”.