Arduino PWM pins 3 and 11 are not working while using Timer1

Hi guys,

I have been working on a project in which I need to use Timer1 interrupt and as well as PWM pins 3 and 11 for controlling the steering and the speed of my car. It seems that when I use Timer 1 pins 3 and 11 stop working. Please can anyone guide me through where am I going wrong?

PWM uses timers. When you take a timer out of the pool, PWM capabilities on two pins goes away.

Use a different timer, if you must use pins 3 and 11 for PWM.

Hi, Thank you for your response. I am confused. So if we use timer 1 on Arduino Uno it breaks the AnalogWrite() on pins 9 and 10. And as you say it might be using pins 3 and 11 as well. Hence does that mean I can use only pins 5 and 6 for controlling the servos?

Hi, I tried using pins 5 and 6 as well but it seems that when I initialise Timer1 and attach Timer1 interrupt none of the PWM seems to be working. I am using the servo library to control the motors. Hence I am unable to control the steering and speed from any of the PWM pins if I use Timer 1. Please help

I guess I found the solution. Timer 1 is reserved for Servo library hence if I try to use it separately the servo library doesnt work on any pwm pin. Please correct me if I am wrong.

DakshGupta: I guess I found the solution. Timer 1 is reserved for Servo library hence if I try to use it separately the servo library doesnt work on any pwm pin. Please correct me if I am wrong.

Yes, the servo library uses Timer1. If you've hijacked timer 1 for y our own purposes then the servo library will not work on any pin.

When not using the timer 1, the servo library allows you to attach servos on any pin, not just the PWM pins.