It so happens that the PWM ports are modulated by timers. Ok I knew that. What I didn't know is that ports are assigned to specific timers, not any available timer. Now that makes a difference. From this link we have the following port/timer assignments:
5 PD 5 PWM T0B
6 PD 6 PWM T0A
9 PB 1 PWM T1A
10 PB 2 PWM T1B
11 PB 3 PWM T2A, MOSI
So timer zero is assigned PWM ports 5 and 6; timer 1 is assigned to pins 9 and 10; and timer 2 is assigned to 3 and 11.
In my application, timer 2 is used for the Quantum Leap Framework, so I could try to use pin 11 for PWM but it will be taken over by my QF/AD framework. So this is a good reason that I couldn't drive the motor from pin 11 via. PWM.
What this chart tells me is that for my specific application, I can't use pins 3 and 11 for PWM, but they are fine as standard digital I/O.
I'm thinking of adding a PWM driven speaker to my project and now I know what ports I can use.
No comments:
Post a Comment