I've been building both AutoPilots, and QuadraCopters, and I wanted to drive more servos and ESCs, with less jitter, so I used some ideas from the Paparazzi gang and developed a way to drive up to 10 servos with just 2 output pins from an Arduino or ATMega8.
The design uses just one chip, a Johnson style Decade Counter, and requires only two output pins from the Arduino. The Arduino uses one PWM pin (pin9), and one general IO pin (pin8). All the pulse are generated in sequence on the PWM pin, then spread out to the individual servos via the decade counter. The decade counter costs 63 cents.
Now I can build Hexa-Copters without having to use I2C ESCs, and still have servo outputs available for camera controls.
Link to Source Code: http://www.photopete.com/swarm/HWServo4017.zip
Comments
Works very well indeed! Thanks a lot. Also Arduino 1.0 compatible. I also took a look at the ServoShield examples. I still have problems with getting my setup working with that, but it seems they have a special mode for the ATmega1280 and a flag for 'HIGHACCURACY'.
You can actually drop this to one pin , and some additional circuitry to drive the 4017 reset pin. Holding the data pin high longer then a regular pulse to charge a capacitor that triggers reset. Here's an example:
http://that.homepage.dk/PDF/1-8_Servo_Expander_v1a.pdf
BTW, this is (almost) exactly how PPM decoders work as well.