I've been experimenting with the analogWrite function, I have a bunch of LED's hooked up to pins 9 to 13. I have timers incrementing counters for each pin from 0 to 255, then back down from 255 to 0 this repeats continuously. Each pin has its own unique counter, the timers are running every 5ms.
Pins 9 and 10 seem to be changing at the same frequency, however pins 12 and 13 change at a different frequency, I'm not sure why, the timers and counters are incrementing at the same frequency as 9 and 10.
I cannot use pin 11, any attempt to use this causes the whole application to fail.
Is there any set-up I need to perform in order to use pins as analog outputs? Is there any reason why the PWM works differently on pins 12 and 13?
I have timers incrementing counters for each pin from 0 to 255, then back down from 255 to 0 this repeats continuously.
There are timers involved in PWM. Different timers for different pairs of pins. If you have stolen the timer for another purpose, you sacrifice PWM on those pins.