Why only 8 servos on the Mega R3 using Servo.h?

Hi all,

I have hit yet another issue with the new Mega R3.

Is there a good reason why only 8 servos are now supported by the Servo.h library? This is claimed by the example program, although the website info seems to be out of date and still claims that 48 are supported (Servo - Arduino Reference)
I find that servos number 9 and 10 glitch when turned on and then don't work at all when numbers 11 and 12 are added.

I was running 16 on the Mega R2 with exactly the same software. Is this a firmware change? Can I work around it? I don't want to use an alternative library if possible (I need the same delays etc).

If this can't be fixed, can anyone suggest a source for the old Mega R2s?

Much appreciated

websitedragon:
Is there a good reason why only 8 servos are now supported by the Servo.h library? This is claimed by the example program,

Not sure why the comments in the Sweep example claim that only 8 servo objects can be created. The servo library sources indicate that it can run 12 servos per timer and the the 1280/2560 has four timers to spare. It creates an array of 48 servo objects.

Not sure why some of your servos aren't running well. Are you using any other libraries that might be using some timers?

Hmm... the mystery gets deeper then. I haven't got any other libraries running. This problem occurs even in the sweep example, with no other code added aside from more servos.

I don't know if it will make any difference but I'll try reloading the bootloader and messing around with the timers to see if I can give it a kick start.

Well I now can't get the bootloader written either. It fails after writing for a minute or two each time with the following message.

avrdude: verification error, first mismatch at byte 0x1e000
0xff != 0x0d
avrdude: verification error; content mismatch

I can no longer upload sketches.

I'm beginning to think I've received a dodgy chip/board.

Hi,

I think the reference to 8 servos may be from the time when only 2 were supported on the UNO, if you look through the source code it supports many timers on the bigger chips and many servos on each of those timers - I think its 48 in total.

Duane B
rcarduino.blogspot.com

Just to let you know that I bought a new Arduino (another Mega R3) and it has worked just fine from the offset. Seeing as I haven't done anything funky with the first one, I presume it was broken when I received it. Boo.

Thank you for the input!