Here's how I did it, but it takes a little more hardware: PWM output generates pulse 0-2000uS long, generated at 1uS resolution (using 4 MHz processor). This comes out the CCPx pin. Another set of pins (RB?) generates an address specifying which servo should be control (3 pins gives 8 servos, 4 gives 16, etc). Now, if you use both PWM outputs, you can control 16 servos with 5 pins, 32 servos with 6, 64 with 7, or 128 with 8, 256 with 9, or 512 with 10. 10 pins is all of RB plus CCP0 and CCP1. Not bad, eh? Best part is, it leaves the processor almost completely free to do something else, with updates to the PWM handled either with an interrupt code or by a routine which is called once per mS (or which just checks the CCPxIF flag). If you drive 128 servos, you can provide about 60Hz output to each one. Downside is that you need a little silicon external to do it. I have done it with a PLD providing the output signals in a very small package. Andy At 02:22 PM 7/20/99 -0500, you wrote: > > No real new documentation on the Pic-Flyer, but my PIC projects section has > a new "advanced servo control techniques and algorithms" page. > > While brainstorming I came up with a way to control more servos with less > processor time (processor time being measured in percentages of one full > second. I may have found a way to control lots of servos, more than 12, and > only use 24% of the processor! I did this by coming up with this great idea: > > Instead of "looping" to generate timed delays, why not just use some advanced > interrupt handler to make better use of that wonderful tmr0. The interrupt > would work like this: > > Begin interrupt (triggered by timer0 every 18mS) > > reload timer0 to overflow in 1mS > Set the pulse output pin high and an interrupt_flag high > Return from interrupt > > Main-line code > > Begin interrupt again (1mS later) > Check to see if flag is high > If so, generate the rest of the delay "manually" (If you are using a > *really* fast processor, 20MHz, try generating the entire pulse with > an interrupt. > Once the delay is over, set the output pulse low. > Set up timer0 to return control in another 18mS > Return from interrupt > > In a nutshell, the entire idea is to provide more execution time to the > main-line code, in the PICFlyer, my servo controller must also handle 2-wire > serial communications, ( a later project. ) > > I posted the document to illustrate a technique I though would be a good > contribution to the list. Speaking of the list, could someone please append > my name and site to David Tait's, now defunct, list of hobbyists? > > Login: at www.intcon.net/~jrclay > Goto: PIC Projects > Goto: Servo Controllers and algorithms > > I have not yet posted the code for the Serial-Parallel controller, just a > single servo controller, I am still working the the method described above > > Myke P. : Your comments please. > ================================================================== Andy Kunz Life is what we do to prepare for Eternity ------------------------------------------------------------------ andy@rc-hydros.com http://www.rc-hydros.com - Race Boats andy@montanadesign.com http://www.montanadesign.com - Electronics ==================================================================