PWM pins 5 and 6

Hi,

I'm trying to use the Arduino PWM pins (3,5,6,9,10,11) to control a set of motors (motors like 6).
Unfortunately I am not getting response on pins 5 and 6.

Researching about these PWM pins, I found that the frequency is divided into pairs (3-11 5-6 9-10) and the pins 5 and 6 work with a greater frequency.

Is there any way to use the pins 5 and 6 in the same way we work with others?
I found the adjustment table below, however I believe that you can not use the same frequency.
Pins 5 and 6: controlled by Timer 0

Setting Divisor Frequency
0x01 1 62500
0x02 8 7812.5
0x03 64 976.5625
0x04 256 244.140625
0x05 1024 61.03515625

TCCR0B = TCCR0B & 0b11111000 | ;

Pins 9 and 10: controlled by timer 1

Setting Divisor Frequency
0x01 1 31250
0x02 8 3906.25
0x03 64 488.28125
0x04 256 122.0703125
0x05 1024 30.517578125

TCCR1B = TCCR1B & 0b11111000 | ;

Pins 11 and 3: controlled by timer 2

Setting Divisor Frequency
0x01 1 31250
0x02 8 3906.25
0x03 32 976.5625
0x04 64 488.28125
0x05 128 244.140625
0x06 256 122.0703125
0x07 1024 30.517578125

TCCR2B = TCCR2B & 0b11111000 | ;

All frequencies are in Hz and assume a 16000000 Hz system clock.

I would like to control an ESC with these pins (5-6) in the same way as the other pins are used.

Could you please help me?

I hope it is not necessary to use a second microcontroller to manage the PWM.

ESCs do not use they type of PWM that analogWrite produces.

To control ESCs you will need to use the servo library, this generates the correct signal expected by and ESC or Servo.

Have a look though some of the articles on this page for background info -

about halfway down you will find a section of links to articles about interfacing with RC Equipment and further down some info about th servo library and using it to drive servos or ESCs.

Duane B

rcarduino.blogspot.com

All timers support divisors of 1, 8, 64, 256, 1024.

Therefore (for the same timer mode) they would all generate the same frequency if you use the same prescaler.

Of course, timer 1 being a 16-bit timer overflows at a different rate than the 8 bit timers. But if you use one of the modes that counts up to 8 bits (eg. PWM, Phase Correct, 8-bit) then you should get identical results.

timer0 controls pins 5 and 6 and also is the "clock" used to implement micros(), millis(), delay() and delayMicroseconds(). It runs in "fast PWM mode" which counts only up and cycles every 256 prescaled clocks

The other timers run in "phase correct PWM mode" - they count up then down then up and cycle every 510 prescaled clocks.

Each timer can have its mode changed from the default, but if you change timer0 you'll break micros(), millis(), delay() and delayMicroseconds().

timer1 is 16 bit (but by default is configured as 8 bits). It controls pins 9 and 10. timer2 is 8 bit and controls pins 11 and 3.

For the Arduino Megas there are more 16 bit timers available and the pin assignments are different.