On 9/09/2011 11:45 AM, Josh Koffman wrote: > I've spent a bunch of time searching but haven't found much that's=20 > enlightening. My problem with projects like the one you linked to is=20 > that because their only purpose is to drive the servo, they aren't=20 > written to do much else, and they don't take advantage of the=20 > peripherals present in the chip. I guess I'm being picky! I am going=20 > to try just writing my own, hopefully it won't go too badly :) Josh=20 Josh, the basic idea is: Set up a free running 20ms timer on tmr0. When tmr0 fires, set the first servo output high and set tmr1 to the=20 pulse width you want for servo 1. When tmr1 fires, turn servo output 1 off, turn servo 2 output on and set=20 tmr1 to the pulse width you want for servo 2. Repeat unitl all servos are serviced, then wait for the 20ms timer to=20 fire again. This round robin works for up to 8 servos as 8 x 2ms =3D 16ms so you can=20 service them all within the 20ms. The pulse positions move about=20 somewhat within each 20ms event, but the servos don't seem to mind. David... --=20 ___________________________________________ David Duffy Audio Visual Devices P/L Unit 8, 10 Hook St, Capalaba 4157 Australia Ph: +61 7 38235717 Fax: +61 7 38234717 Our Web Site: www.audiovisualdevices.com.au ___________________________________________ --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .