Why use a PWM expander for servos?

Hi all.

I've got a project that will be using a lot of servos.

What's the difference between controlling the servos using a mega, which can handle up to 48 servos (Servo - Arduino Reference), and using a PWM expander (Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface [PCA9685] : ID 815 : $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits)? (Other than the amount of pins used on the mega)

Are there any performance differences between either method?

Thanks! :slight_smile:

The Servo library relies on interrupts. If you use something like SoftwareSerial that disables interrupts for significant amounts of time you will get jitter in your servos. The hardware solution would not be subject to that interrupt latency jitter.

Also the Servo library appropriates timers, so if you need those hardware timers for
other purposes an external PWM driver makes sense. And sometimes you need all
the pins for other things too - even on the Mega!