Need to setup TIMER3 on Mega to higher frenquency PWM
November 4, 2011
I need to set TIMER3, controlling pins 2 and 3 on an Arduino Mega to either fast PWM mode (acceptable) or faster (higher frequency)(preferable).
I use this PWM to control an audio signal through a Silonex light sensitive resistor/LED unint and some audio contamination can be heard because of the speed at which the Silonex reacts. I used TIMER0 in tests with a prescaler of 1 and it works OK. But TIMER1 is "fast" PWM and TIMER3 is "phase correct".
So, either I make TIMER3 "fast" or even better, I set TIMER3 even faster (I would like to try a maximum frequency of 125000 or 250000 Hz if that's possible. A "fast" PWM does 62500 max).
I have read the whole "Arduino 101: Timers and Interrupts"a few times, but I'm just not good enough to "get it".