>I'm working on a project (currently using the >PIC16F84) in which I would like to be able to set the >servo (1-8) to a specific setting (1=Extreme >left/128=center/255=extreme right -- or whatever) I wrote a program that controls a single servo, adjusting the pulse widths for jitter-free operation at any setting along its range of motion, controlled with a potentiometer input to the A/D. With only 3 locations predefined, it should be fairly simple. What's your input source to determine the servo positions? The only thing you really have to worry about is the resolution. If you're off by ~5us in pulse widths, you're going to jitter back and forth. >figure this would have to be table driven, but just >can't get this to work. The timing is something else At 20MHz, you should be a little better off than I was at 4MHz, as you can tolerate more variation in the instruction cycle counts for pulse timing. At 50Hz cycles to the servo, you could just put the delay time for the high pulse in the table for each of your 3 positions and send the line low for the remainder. As for handling 8 servos simultaneously, you'd have to poll each servo's delay timing to shut it off at the right time. This is where you might run into trouble with jitter. But with 8 servos and 20ms between cycles for each servo, you could pulse one servo, wait for the 1-2ms high pulse, then move on to the next servo. You'd run through all 8 in only 16ms, leaving 4ms for any other calculations you might want to do. At 20MHz, that's quite a few instructions. Or, better yet, you can set up an interrupt to go off at your 1-2ms pulse time and send the line low, if 4ms isn't enough to do whatever you have to do between pulses. If you keep the same values going through the loop (only 3 distinct servo positions), you probably won't have any problem with jitter. You should be able to do this with an '84 without a problem, if you don't want to shell out the expense for the '877. And if any of this advice doesn't seem right, ignore it... I'm having bad luck today :) --Andrew _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.